nongbin commited on
Commit
c60583f
·
1 Parent(s): 191b01b

add visualizing graph

Browse files
.gitignore CHANGED
@@ -3,3 +3,4 @@ __pycache__
3
  dickens/
4
  book.txt
5
  lightrag-dev/
 
 
3
  dickens/
4
  book.txt
5
  lightrag-dev/
6
+ *.idea
.idea/.gitignore ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
.idea/LightRAG.iml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="PYTHON_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="inheritedJdk" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ </component>
8
+ <component name="PyDocumentationSettings">
9
+ <option name="format" value="PLAIN" />
10
+ <option name="myDocStringFormat" value="Plain" />
11
+ </component>
12
+ </module>
.idea/inspectionProfiles/Project_Default.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
5
+ <option name="myValues">
6
+ <value>
7
+ <list size="7">
8
+ <item index="0" class="java.lang.String" itemvalue="nobr" />
9
+ <item index="1" class="java.lang.String" itemvalue="noembed" />
10
+ <item index="2" class="java.lang.String" itemvalue="comment" />
11
+ <item index="3" class="java.lang.String" itemvalue="noscript" />
12
+ <item index="4" class="java.lang.String" itemvalue="embed" />
13
+ <item index="5" class="java.lang.String" itemvalue="script" />
14
+ <item index="6" class="java.lang.String" itemvalue="h1" />
15
+ </list>
16
+ </value>
17
+ </option>
18
+ <option name="myCustomValuesEnabled" value="true" />
19
+ </inspection_tool>
20
+ <inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
21
+ <option name="ignoredPackages">
22
+ <value>
23
+ <list size="1">
24
+ <item index="0" class="java.lang.String" itemvalue="ahocorasick" />
25
+ </list>
26
+ </value>
27
+ </option>
28
+ </inspection_tool>
29
+ <inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
30
+ <option name="ignoredIdentifiers">
31
+ <list>
32
+ <option value="object.__del__" />
33
+ <option value="file_path" />
34
+ </list>
35
+ </option>
36
+ </inspection_tool>
37
+ </profile>
38
+ </component>
.idea/inspectionProfiles/profiles_settings.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
.idea/misc.xml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Black">
4
+ <option name="sdkName" value="lightrag" />
5
+ </component>
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="lightrag" project-jdk-type="Python SDK" />
7
+ </project>
.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/LightRAG.iml" filepath="$PROJECT_DIR$/.idea/LightRAG.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
examples/graph_visual.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import networkx as nx
2
+ from pyvis.network import Network
3
+
4
+ # Load the GraphML file
5
+ G = nx.read_graphml('./dickens/graph_chunk_entity_relation.graphml')
6
+
7
+ # Create a Pyvis network
8
+ net = Network(notebook=True)
9
+
10
+ # Convert NetworkX graph to Pyvis network
11
+ net.from_nx(G)
12
+
13
+ # Save and display the network
14
+ net.show('knowledge_graph.html')
requirements.txt CHANGED
@@ -11,3 +11,4 @@ tiktoken
11
  torch
12
  transformers
13
  xxhash
 
 
11
  torch
12
  transformers
13
  xxhash
14
+ pyvis