Skip to content

Commit 6a8cea6

Browse files
authored
Fixed README (#173)
1 parent 678002b commit 6a8cea6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ Follow installation instructions [here](https://pygraphviz.github.io/documentati
4343
Assumption: Neo4j running
4444

4545
```python
46+
import asyncio
47+
4648
from neo4j import GraphDatabase
4749
from neo4j_graphrag.embeddings import OpenAIEmbeddings
4850
from neo4j_graphrag.experimental.pipeline.kg_builder import SimpleKGPipeline
@@ -59,7 +61,7 @@ relations = ["PARENT_OF", "HEIR_OF", "RULES"]
5961
potential_schema = [
6062
("Person", "PARENT_OF", "Person"),
6163
("Person", "HEIR_OF", "House"),
62-
("House", "RULES", "Planet")
64+
("House", "RULES", "Planet"),
6365
]
6466

6567
# Instantiate an Embedder object
@@ -82,13 +84,15 @@ kg_builder = SimpleKGPipeline(
8284
embedder=embedder,
8385
entities=entities,
8486
relations=relations,
85-
on_error="CONTINUE",
87+
on_error="IGNORE",
8688
from_pdf=False,
8789
)
8890

89-
await kg_builder.run_async(
90-
text=""""The son of Duke Leto Atreides and the Lady Jessica, Paul is the heir of
91+
asyncio.run(
92+
kg_builder.run_async(
93+
text=""""The son of Duke Leto Atreides and the Lady Jessica, Paul is the heir of
9194
House Atreides, an aristocratic family that rules the planet Caladan."""
95+
)
9296
)
9397
```
9498

0 commit comments

Comments
 (0)