<｜begin▁of▁sentence｜>### Instruction:
Given the High-energy theory collaborations Graph which you can read from a gml file named hep-th.gml, can you use the Louvain method in cdlib to perform community detection? And can you calculate the size (the number of nodes) of the detected communities?
### Response:
import networkx as nx
from cdlib import algorithms, evaluation

# Loading the High-energy theory collaborations graph
g = nx.read_gml('hep-th.gml')

# Perform community detection using the Louvain method
communities = algorithms.louvain(g)

# Calculate the size of the detected communities
community_sizes = evaluation.size(g, communities)

# Printing community sizes
print(community_sizes)
<|EOT|>
