PathRAG
PathRAG copied to clipboard
Add graph visualization feature
Changes introduced:
Adds visualize_graph.py, that generates an HTML visualization of the knowledge graph (graph_chunk_entity_relation.graphml):
These changes are important, as they help the user to identify problems with unconnected nodes and easily debug the processed knowledge graph.
- It adds the weights on the edge label of connected nodes.
- All nodes have a tooltip with category, description and chunk source.
How to test:
- Process a
sample.txtor add a readygraph_chunk_entity_relation.graphmlfile. - Run
visualize_graph.py. - Open
knowledge_graph.html.
Obs: If preferred, the functionality could be implemented to automatically generate the visualization HTML, it if executes after graph creation: https://github.com/BUPT-GAMMA/PathRAG/blob/2785a12de7519b1869483b31ed8716179e7bc03e/PathRAG/storage.py#L259-L260