Repository navigation
Replies: 3 comments
|
The important distinction here is whether you want to constrain only entity extraction or also the allowed relationships and properties in the final graph. Those are related, but they affect different parts of the pipeline and often need different controls. I would start by testing the ontology directly in the extraction prompt so the model reasons inside those boundaries from the beginning. Post-filtering can still help, but it is usually weaker than getting the ontology into the extraction stage itself. |
|
You can partially achieve this in GraphRAG through its graph extraction configuration and custom prompts. For example, you can define your preferred entity types in extract_graph:
entity_types:
- FARMER
- CROP
- CLIMATE_HAZARD
- SOIL_TYPE
- REGION
- AGRICULTURAL_PRACTICEGraphRAG uses this list to guide entity extraction. You can also provide a custom extraction prompt through the For your use case, I would suggest the following approach:
One limitation worth noting is that GraphRAG's standard Documentation:
This should give you a more controlled extraction pipeline without treating the ontology itself as a source document. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have predefined the ontology, or the structure of knowledge graph. Can I ask graphrag to generate knowledge graph from documents according to my ontology?
The ontology can be provided with text. Can I put it in the input folder and not extract entity from it?
I have also tried to refer to the ontology specification from prompts, but it doesn't seem to work.
I would greatly appreciate any guidance or suggestions on how to approach this problem.
All reactions