<｜begin▁of▁sentence｜>### Instruction:
Given a graph which you can read from 'graph_data.gml', can you use the community_edge_betweenness function in igraph to detect the community structure and print the membership of each vertex?
### Response:
import igraph as ig

# Read graph from file
g = ig.Graph.Read_GML('graph_data.gml')

# Perform community detection based on edge betweenness
community_dendrogram = g.community_edge_betweenness(directed=False, weights=None)

# Convert the dendrogram into a clustering at the optimal cut
optimal_clustering = community_dendrogram.as_clustering()

# Print the membership of each vertex
print(optimal_clustering.membership)
<|EOT|>
