1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@ __pycache__
|
|||||||
dickens/
|
dickens/
|
||||||
book.txt
|
book.txt
|
||||||
lightrag-dev/
|
lightrag-dev/
|
||||||
|
.idea/
|
14
examples/graph_visual.py
Normal file
14
examples/graph_visual.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import networkx as nx
|
||||||
|
from pyvis.network import Network
|
||||||
|
|
||||||
|
# Load the GraphML file
|
||||||
|
G = nx.read_graphml('./dickens/graph_chunk_entity_relation.graphml')
|
||||||
|
|
||||||
|
# Create a Pyvis network
|
||||||
|
net = Network(notebook=True)
|
||||||
|
|
||||||
|
# Convert NetworkX graph to Pyvis network
|
||||||
|
net.from_nx(G)
|
||||||
|
|
||||||
|
# Save and display the network
|
||||||
|
net.show('knowledge_graph.html')
|
@@ -11,3 +11,4 @@ tiktoken
|
|||||||
torch
|
torch
|
||||||
transformers
|
transformers
|
||||||
xxhash
|
xxhash
|
||||||
|
pyvis
|
Reference in New Issue
Block a user