<｜begin▁of▁sentence｜>### Instruction:
Given a Network Science coauthorship graph, which can be read from a GML file named netscience.gml, can you apply both Louvain and Leiden community detection algorithms and then compute the Adjusted Rand Index to evaluate the similarity of the two resulting partitions?
### Response:
import networkx as nx
from cdlib import algorithms, evaluation

# Load the graph
G = nx.read_gml('netscience.gml')

# Perform community detection using two different algorithms
louvain_communities = algorithms.louvain(G)
leiden_communities = algorithms.leiden(G)

# Evaluate the similarity of the two partitions using Adjusted Rand Index
ari = evaluation.adjusted_rand_index(louvain_communities, leiden_communities)

print(ari.score)
<|EOT|>
