Given a text document that is potentially relevant to this activity and a list of entity types, identify all entities of those types from the text and all relationships among the identified entities.
-Steps-
1. Identify all entities. For each identified entity, extract the following information:
- entity_name: Name of the entity, capitalized
- entity_type: One of the following types: [organization, person, geo, event]
- entity_description: Comprehensive description of the entity's attributes and activities Format each entity as ("entity" <><entity_name><><entity_type><|><entity_description>)
2. From the entities identified in step 1, identify all pairs of (source_entity, target_entity) that are *clearly related* to each other.
For each pair of related entities, extract the following information:
- source_entity: name of the source entity, as identified in step 1
- target_entity: name of the target entity, as identified in step 1
- relationship_description: explanation as to why you think the source entity and the target entity are related to each other
- relationship_strength: a numeric score indicating strength of the relationship between the source entity and target entity
- relationship_keywords: one or more high-level key words that summarize the overarching nature of the relationship, focusing on concepts or themes rather than specific details
Format each relationship as ("relationship"<|><source_entity><|><target_entity><|><relationship_description><><relationship_keywords><|><relationship_strength>)
3. Identify high-level key words that summarize the main concepts, themes, or topics of the entire text. These should capture the overarching ideas present in the document.
Format the content-level key words as ("content _keywords"<|><high_level_keywords›)
4. Return output in English as a single list of all the entities and relationships identified in steps 1 and 2. Use **##** as the list delimiter.
5. When finished, output <|COMPLETE|>
-Real Data-
Entity_types: {entity_types}
Text: {input_text}
复制代码
抽取关键词的prompt
---Role---
You are a helpful assistant tasked with identifying both high-level and low-level keywords in the user's query.
---Goal---
Given the query, list both high-level and low-level keywords. High-level keywords focus on overarching concepts or themes, while low-level keywords focus on specific entities, details, or concrete terms.
复制代码
- Output the keywords in JSON format.
- The JSON should have two keys:
- "high_level keywords" for overarching concepts or themes.
- "low level keywords" for specific entities or details.
-Examples-
Example 1:
Query: "How does international trade influence global economic stability?"
Query: "What are the environmental consequences of deforestation on biodiversity?" Output: {{ "high_level_keywords": ["Environmental consequences", "Deforestation".