<｜begin▁of▁sentence｜>### Instruction:
Given the Word Adjacencies Graph which you can read from a gml file named adjnoun.gml, can you use the Louvain method in cdlib to perform community detection? And can you compute the average distance within each community detected? Notes: You need to print the average distance within the communities.
### Response:
import networkx as nx
from cdlib import algorithms, evaluation

# Create a graph from the word adjacencies dataset
G = nx.read_gml('adjnoun.gml')

# Detect communities using a community detection algorithm
communities = algorithms.louvain(G)

# Compute the average distance within the detected communities
avg_dist = evaluation.avg_distance(G, communities)

# Print the average distance
print(avg_dist.score)
<|EOT|>
