<｜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 ricci_community function in cdlib to perform community detection? And can you export the community detection result to a JSON format?
### Response:
import networkx as nx
from cdlib import algorithms

# Reading high-energy theory collaborations graph
G = nx.read_gml('hep-th.gml')

# Detecting communities using Ricci curvature
coms = algorithms.ricci_community(G)

# Export community detection result to JSON
coms_json = coms.to_json()
print(coms_json)
<|EOT|>
