Spaces:
Running
Running
Ilyas KHIAT
commited on
Commit
·
f903fca
1
Parent(s):
adf8396
test
Browse files
audit_page/knowledge_graph.py
CHANGED
@@ -93,7 +93,9 @@ def convert_neo4j_to_agraph(neo4j_graph, node_colors):
|
|
93 |
shape = "circle" # Default shape, can be customized
|
94 |
|
95 |
# For example purposes, no images are added, but you can set 'image' if needed.
|
96 |
-
|
|
|
|
|
97 |
|
98 |
# Creating Agraph edges
|
99 |
for relationship in neo4j_graph.relationships:
|
|
|
93 |
shape = "circle" # Default shape, can be customized
|
94 |
|
95 |
# For example purposes, no images are added, but you can set 'image' if needed.
|
96 |
+
new_node = Node(id=node_id,title=type, label=label, size=size, shape=shape,color=node_colors[type])
|
97 |
+
if not if_node_exists(nodes, new_node.id):
|
98 |
+
nodes.append(new_node)
|
99 |
|
100 |
# Creating Agraph edges
|
101 |
for relationship in neo4j_graph.relationships:
|
utils/kg/construct_kg.py
CHANGED
@@ -5,7 +5,7 @@ from langchain_core.documents import Document
|
|
5 |
|
6 |
def get_graph(text,allowed_nodes=None,prompt=None):
|
7 |
|
8 |
-
llm = ChatOpenAI(temperature=0, model_name="gpt-4o")
|
9 |
|
10 |
if allowed_nodes:
|
11 |
llm_transformer = LLMGraphTransformer(llm=llm,allowed_nodes=allowed_nodes)
|
|
|
5 |
|
6 |
def get_graph(text,allowed_nodes=None,prompt=None):
|
7 |
|
8 |
+
llm = ChatOpenAI(temperature=0, model_name="gpt-4o-2024-08-06")
|
9 |
|
10 |
if allowed_nodes:
|
11 |
llm_transformer = LLMGraphTransformer(llm=llm,allowed_nodes=allowed_nodes)
|