<｜begin▁of▁sentence｜>### Instruction:
As a forester, you may have access to network data related to political books and political blogs. Suppose you are interested in comparing the performance of different community detection algorithms in these networks to understand how different ideas and opinions are clustered. The plot_scoring function from the Community Discovery Library (cdlib) can be utilized for this purpose. Specifically, you can compare the Louvain and Label Propagation algorithms in terms of Adjusted Normalized Mutual Information to see which one provides more accurate community detection results. Additionally, the graphs contain ground truth community attributions stored as node attributes named 'community', which can be used for evaluation.
### Response:
from cdlib import algorithms, viz, evaluation
import networkx as nx

# Load graph from GML file
G1 = nx.read_gml('polbooks.gml')
G2 = nx.read_gml('polblogs.gml')

# Creating a reference partition for each graph using ground truth communities
references = []
# Assuming the ground truth for each node's community membership is encoded in a node attribute 'community'
references.append(evaluation.NodeClustering({frozenset(G1.nodes[v]['community']) for v in G1}, graph=G1, method_name="reference"))
references.append(evaluation.NodeClustering({frozenset(G2.nodes[v]['community']) for v in G2}, graph=G2, method_name="reference"))

# Define the list of graph names
names = ["polbooks", "polblogs"]

# Define the list of graphs
graphs = [G1, G2]

# Define the community detection algorithms to evaluate
algos = [algorithms.louvain, algorithms.label_propagation]

# Perform the scoring using Adjusted Normalized Mutual Information (anmi) and plot the results
viz.plot_scoring(graphs, references, names, algos, scoring=evaluation.adjusted_mutual_information, nbRuns=2)
<|EOT|>
