# Graph Extraction

The graph extraction is done by `GraphExtractor` class. 

It is a simple wrapper over 3 components.

Note:
    You should be able to pass your own implementations of these components provided they follow the same protocol.


## EntityRelationshipExtractor 

This component generates a `networkx` graph for every `text_unit` in the dataframe.

See [this](er_extraction.ipynb) for a detailed guide on this component.

## GraphsMerger

Merges all the graphs generated by `EntityRelationshipExtractor` into a single graph.

The merging is done by creating a list of descriptions for the nodes and edges.

## EntityRelationshipDescriptionSummarizer

Every node and edge in the merged graph has more than one description. 

This component uses LLM to summarize the descriptions of all nodes & edges in the merged graph.

