|
6 | 6 |
|
7 | 7 | ENTITY_EXTRACTION_INSTRUCTIONS = """ |
8 | 8 | ## Overview |
9 | | -You are a meticulous analyst tasked with extracting information from unstructured text |
| 9 | +You are a meticulous analyst tasked with identifying potential entities from unstructured text |
10 | 10 | to build a knowledge graph in a structured json format of entities (nodes) and their relationships (edges). |
11 | | -The graph will be stored in a MongoDB Collection and traversed using $graphLookup |
12 | | -from starting points of entity nodes matching names found in a query, and follow their relationships. |
13 | | -
|
14 | | -Use the following as guidelines. |
15 | | -
|
16 | | -- Simplicity: The graph should have as few entities and relationship types as needed to convey the information in the input. |
17 | | -- Consistency: Connections can only be made if entities and relationships use consistent naming. |
18 | | -- Generality: The graph should be useful for describing the concepts in not just this document but other similar documents. |
19 | | -- Accuracy: Do not add any information that is not explicitly mentioned in the text. |
| 11 | +**Include as many entities and relationships as you can.** |
20 | 12 |
|
21 | 13 | INPUT: You will be provided a text document. |
22 | 14 | OUTPUT: |
|
92 | 84 | or human-readable identifiers, found in the text. |
93 | 85 |
|
94 | 86 | **Allowed Entity Types**: |
| 87 | +- By default, all types are permitted. |
95 | 88 | - If a non-empty list is provided, extract ONLY entities whose `type` matches one of the following: [{allowed_entity_types}]. |
96 | | -- NOTE: If this list is empty, anything is permitted. |
97 | 89 |
|
98 | 90 | ### Examples of Exclusions: |
99 | 91 | - If `allowed_entity_types` is `["Person", "Organization"]`, and the text mentions an "Event" or "Location", |
|
0 commit comments