Skip to content

Commit a456d0b

Browse files
authored
update neo4j extraction prompts in the example (#408)
* simplify neo4j example * update graph extraction prompts
1 parent d053389 commit a456d0b

File tree

1 file changed

+6
-3
lines changed
  • examples/docs_to_knowledge_graph

1 file changed

+6
-3
lines changed

examples/docs_to_knowledge_graph/main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ class DocumentSummary:
1313

1414
@dataclasses.dataclass
1515
class Relationship:
16-
"""Describe a relationship between two entities."""
16+
"""
17+
Describe a relationship between two entities.
18+
Subject and object should be Core CocoIndex concepts only, should be nouns. For example, `CocoIndex`, `Incremental Processing`, `ETL`, `Data` etc.
19+
"""
1720
subject: str
1821
predicate: str
1922
object: str
@@ -62,8 +65,8 @@ def docs_to_kg_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.D
6265
output_type=list[Relationship],
6366
instruction=(
6467
"Please extract relationships from CocoIndex documents. "
65-
"Focus on concepts and ingnore specific examples. "
66-
"Each relationship should be a tuple of (subject, predicate, object).")))
68+
"Focus on concepts and ignore examples and code. "
69+
)))
6770

6871
with doc["relationships"].row() as relationship:
6972
# relationship between two entities

0 commit comments

Comments
 (0)