Skip to content

Hypergraph is more powerful. Transform unstructured text into structured knowledge with LLMs. Graphs, hypergraphs, and spatio-temporal extractions — with one command.

feat: 更新农业、生命科学和商业领域的提取模板,增强提取规则和专业指导

yifanfeng97fb385073ff39
diff --git a/hyperextract/templates/en/agriculture/crop_cycle.py b/hyperextract/templates/en/agriculture/crop_cycle.py
index 8f4b54f..bc7f4c1 100644
--- a/hyperextract/templates/en/agriculture/crop_cycle.py
+++ b/hyperextract/templates/en/agriculture/crop_cycle.py
@@ -38,13 +38,22 @@ CROP_CYCLE_PROMPT = (
)
CROP_CYCLE_NODE_PROMPT = (
- "Extract key agricultural components: crop types, growth stages, environmental conditions (soil/pH/temp), "
- "farming tasks, and biological stresses (pests/fungi). Provide a clear category for each."
+ "You are an expert agronomist. Your task is to identify and extract all key agricultural entities (Nodes) from the text.\n\n"
+ "Extraction Rules:\n"
+ "- Identify crop types, specific growth stages, environmental factors (e.g., pH, temperature), and farming tasks.\n"
+ "- Capture biological stresses such as specific pests, fungi, or diseases.\n"
+ "- Classify each node into the appropriate category: 'Crop', 'Growth Stage', 'Task/Activity', etc.\n"
+ "- DO NOT identify sequences or dependencies between these entities at this stage."
)
CROP_CYCLE_EDGE_PROMPT = (
- "Establish logical links in the crop cycle. Connect stages in sequence, link tasks to the stages they belong to, "
- "and map environmental requirements to the entities they affect. Use specific relation types like 'requires' or 'inhibits'."
+ "You are an expert agronomist. Given the list of agricultural entities, map the logical links and cycles (Edges).\n\n"
+ "Extraction Rules:\n"
+ "- Establish sequential links between growth stages.\n"
+ "- Link farming tasks to the specific growth stages where they must be performed.\n"
+ "- Map how environmental conditions and pests impact the crop or its stages.\n"
+ "- Use specific relation types such as 'is at stage', 'requires task', 'inhibits', or 'applied to'.\n"
+ "- Only connect entities that exist in the provided agricultural entity list."
)
# ==============================================================================
diff --git a/hyperextract/templates/en/biology/metabolic.py b/hyperextract/templates/en/biology/metabolic.py
index 7b7b9a4..c79153b 100644
--- a/hyperextract/templates/en/biology/metabolic.py
+++ b/hyperextract/templates/en/biology/metabolic.py
@@ -41,12 +41,21 @@ METABOLIC_CONSOLIDATED_PROMPT = (
)
METABOLIC_NODE_PROMPT = (
- "Identify all chemical substances (metabolites) and enzymes. Focus on accurate nomenclature."
+ "You are a biochemist. Your task is to identify all metabolites and catalytic enzymes (Nodes) involved in metabolic processes.\n\n"
+ "Extraction Rules:\n"
+ "- Identify chemical components (substrates/products) and the enzymes that facilitate their transformation.\n"
+ "- Capture formulas, charges, and cellular compartments if described.\n"
+ "- Ensure names are standardized (e.g., 'Glucose-6-phosphate').\n"
+ "- DO NOT construct reaction equations or complexes at this stage."
)
METABOLIC_EDGE_PROMPT = (
- "Define hyperedges representing metabolic reactions. Include ALL participating metabolites and enzymes "
- "for each identified reaction event."
+ "You are a biochemist. Given the following list of metabolites and enzymes, extract complex metabolic reactions (Hyperedges).\n\n"
+ "Extraction Rules:\n"
+ "- Group all participants (substrates, products, and enzymes) into single reaction events.\n"
+ "- Clearly distinguish between substrates (inputs) and products (outputs) within the reaction metadata.\n"
+ "- Only include participants that exist in the provided entity list.\n"
+ "- Record stoichiometry and reversibility where specific data is available."
)
# ==============================================================================
diff --git a/hyperextract/templates/en/biology/network.py b/hyperextract/templates/en/biology/network.py
index 09c609c..f09303e 100644
--- a/hyperextract/templates/en/biology/network.py
+++ b/hyperextract/templates/en/biology/network.py
@@ -41,13 +41,21 @@ NETWORK_CONSOLIDATED_PROMPT = (
)
NETWORK_NODE_PROMPT = (
- "Identify all genes, proteins, and molecules mentioned. Normalize names to standard symbols where possible. "
- "Ignore generic terms like 'the protein' or 'this molecule' unless they refer to a specific named entity."
+ "You are a bioinformatics expert. Your task is to identify all molecular entities (Nodes) mentioned in the text.\n\n"
+ "Extraction Rules:\n"
+ "- Identify genes, proteins, RNAs, and metabolites. Use standard nomenclature (e.g., HGNC symbols).\n"
+ "- Capture synonyms and biological functions where available.\n"
+ "- Exclude generic biological terms unless they are acting as specific placeholders for known molecules.\n"
+ "- DO NOT extract interactions or state changes at this stage."
)
NETWORK_EDGE_PROMPT = (
- "Extract functional and physical interactions between the identified bio-entities. "
- "Define the direction and nature of the interaction (Activation, Inhibition, etc.)."
+ "You are a bioinformatics expert. Given the following list of molecular entities, extract their physical and functional interactions (Edges).\n\n"
+ "Extraction Rules:\n"
+ "- Identify the type of interaction (Phosphorylation, Inhibition, Activation, Binding, etc.).\n"
+ "- Specify the directionality (source acts on target).\n"
+ "- Only create edges between entities present in the provided list.\n"
+ "- Include the biochemical mechanism and interaction strength if mentioned."
)
# ==============================================================================
diff --git a/hyperextract/templates/en/biology/taxonomy.py b/hyperextract/templates/en/biology/taxonomy.py
index 832ab4e..d8a2459 100644
--- a/hyperextract/templates/en/biology/taxonomy.py
+++ b/hyperextract/templates/en/biology/taxonomy.py
@@ -39,13 +39,21 @@ TAXONOMY_CONSOLIDATED_PROMPT = (
)
TAXONOMY_NODE_PROMPT = (
- "Extract all biological taxonomic groups (Nodes). Identify their ranks (e.g., Family: Hominidae). "
- "Focus on formal classifications and exclude transient or non-standard groupings."
+ "You are a professional taxonomist. Your task is to identify and extract all biological taxonomic units (Nodes) from the text.\n\n"
+ "Extraction Rules:\n"
+ "- Identify the scientific name and assigned rank (e.g., Domain, Kingdom, Phylum, Class, Order, Family, Genus, Species) for each taxon.\n"
+ "- Capture common names and brief descriptions if provided.\n"
+ "- Focus exclusively on formal biological classifications.\n"
+ "- DO NOT extract relationships between taxons at this stage."
)
TAXONOMY_EDGE_PROMPT = (
- "Map the lineage of the provided taxons. Create edges that reflect the phylogenetic descent "
- "or classification tree. Ensure the source is higher or equal in rank to the target."
+ "You are a professional taxonomist. Given the following list of identified taxons, extract the hierarchical relationships (Edges) described in the text.\n\n"
+ "Extraction Rules:\n"
+ "- Establish 'parent_of' links where a higher-rank taxon contains a lower-rank one.\n"
+ "- Ensure the lineage accurately reflects the phylogenetic or systematic tree described.\n"
+ "- Only connect nodes that exist in the provided taxon list.\n"
+ "- Complement the relationship with any evidence or genomic context mentioned."
)
# ==============================================================================
diff --git a/hyperextract/templates/en/business/ecosystem.py b/hyperextract/templates/en/business/ecosystem.py
index b676cc7..09b8eb2 100644
--- a/hyperextract/templates/en/business/ecosystem.py
+++ b/hyperextract/templates/en/business/ecosystem.py
@@ -38,12 +38,21 @@ ECOSYSTEM_CONSOLIDATED_PROMPT = (
)
ECOSYSTEM_NODE_PROMPT = (
- "Identify all business and regulatory actors in the ecosystem. Note their market ranks and tech focus."
+ "You are a market analyst. Your task is to identify all participants (Nodes) within an industrial ecosystem.\n\n"
+ "Extraction Rules:\n"
+ "- Identify companies, NGOs, and regulatory bodies mentioned.\n"
+ "- Capture their market rank and primary technological focus area.\n"
+ "- Focus on naming actors that collaborate or compete as a group.\n"
+ "- DO NOT identify alliances, joint ventures, or consortia at this stage."
)
ECOSYSTEM_EDGE_PROMPT = (
- "Extract collective alliances. Group participating entities into clusters (hyperedges). "
- "Focus on consortiums, standard-setting bodies, and joint market actions."
+ "You are a market analyst. Given the industrial participants, extract the collective relationships (Hyperedges).\n\n"
+ "Extraction Rules:\n"
+ "- Group multiple participants (3+) into alliances, standard bodies, or joint ventures.\n"
+ "- Define the shared goal (e.g., 'R&D', 'Anti-monopoly Review') for the entire group.\n"
+ "- Record any mentioned governance structures or leading participants.\n"
+ "- Ensure every group member is selected from the provided participants list."
)
# ==============================================================================
diff --git a/hyperextract/templates/en/business/equity.py b/hyperextract/templates/en/business/equity.py
index e344eff..7b496dc 100644
--- a/hyperextract/templates/en/business/equity.py
+++ b/hyperextract/templates/en/business/equity.py
@@ -40,13 +40,21 @@ EQUITY_CONSOLIDATED_PROMPT = (
)
EQUITY_NODE_PROMPT = (
- "Extract all companies, investment funds, and individuals mentioned in the context of ownership. "
- "Classify them into 'Natural Person', 'Private Company', etc."
+ "You are a corporate paralegal and financial analyst. Your task is to identify all stakeholders (Nodes) within a corporate structure.\n\n"
+ "Extraction Rules:\n"
+ "- Identify companies, investment funds, government bodies, and individual persons.\n"
+ "- Classify each as 'Natural Person', 'Public Company', 'Private Company', etc.\n"
+ "- Flag entities identified as Ultimate Beneficial Owners (UBO) where explicit.\n"
+ "- DO NOT extract ownership percentages or control links at this stage."
)
EQUITY_EDGE_PROMPT = (
- "Construct ownership edges. Capture the percentage of equity and the specific type of control. "
- "Identify the flow of capital from shareholder to the target entity."
+ "You are a corporate paralegal and financial analyst. Given the list of stakeholders, map the ownership and control relationships (Edges).\n\n"
+ "Extraction Rules:\n"
+ "- Extract the exact percentage of equity held between a shareholder (source) and a company (target).\n"
+ "- Specify the nature of control (e.g., Voting Rights, Direct Control, Nominee Shareholding).\n"
+ "- Create edges only between entities found in the provided stakeholder list.\n"
+ "- Capture the 'as of' date or historical period for the ownership record."
)
# ==============================================================================
diff --git a/hyperextract/templates/en/business/strategy.py b/hyperextract/templates/en/business/strategy.py
index 519aa42..520bc80 100644
--- a/hyperextract/templates/en/business/strategy.py
+++ b/hyperextract/templates/en/business/strategy.py
@@ -40,12 +40,21 @@ STRATEGY_CONSOLIDATED_PROMPT = (
)
STRATEGY_NODE_PROMPT = (
- "Extract business units, product lines, and high-level corporate goals. Identify their organizational importance."
+ "You are a management consultant. Your task is to identify strategic entities and objectives (Nodes).\n\n"
+ "Extraction Rules:\n"
+ "- Identify business divisions, specific products, and overarching corporate goals (e.g., 'Sustainability').\n"
+ "- Determine the scope and organizational importance of each unit.\n"
+ "- Focus on nouns and noun phrases representing strategic focus areas.\n"
+ "- DO NOT extract strategic moves or transitions at this stage."
)
STRATEGY_EDGE_PROMPT = (
- "Map strategic transitions over time. Ensure the 'timestamp' is resolved to specific periods. "
- "Identify what the company moved FROM (source) and what it moved TO (target)."
+ "You are a management consultant. Given the identified strategic units, map the temporal shifts in strategy (Edges).\n\n"
+ "Extraction Rules:\n"
+ "- Extract 'Pivots' and actions like 'Acquire', 'Divest', or 'Sunset'.\n"
+ "- Link the source (old focus) to the target (new focus) with a precise timestamp.\n"
+ "- Capture the underlying rationale and any financial commitment (budget) mentioned.\n"
+ "- Only reference nodes present in the strategic units list."
)
# ==============================================================================
diff --git a/hyperextract/templates/en/chemistry/molecular.py b/hyperextract/templates/en/chemistry/molecular.py
index 2368f4b..27344a7 100644
--- a/hyperextract/templates/en/chemistry/molecular.py
+++ b/hyperextract/templates/en/chemistry/molecular.py
@@ -40,12 +40,21 @@ MOLECULAR_CONSOLIDATED_PROMPT = (
)
MOLECULAR_NODE_PROMPT = (
- "Extract all individual atoms. Note their element type and electronic hybridization states."
+ "You are a computational chemist. Your task is to identify and extract all individual atoms (Nodes) from the molecular structure.\n\n"
+ "Extraction Rules:\n"
+ "- Identify the unique atom identifier (e.g., C1) and its chemical element symbol.\n"
+ "- Capture the electronic hybridization state (sp, sp2, sp3) and formal charge for each atom.\n"
+ "- Focus on maintaining the exact nomenclature present in the source text.\n"
+ "- DO NOT identify bonds or spatial connectivity at this stage."
)
MOLECULAR_EDGE_PROMPT = (
- "Map the connectivity (bonds) between atoms. Specifically identify the spatial position "
- "where the connection occurs within the molecular framework."
+ "You are a computational chemist. Given the list of atoms, map the chemical bonds and spatial connectivity (Edges).\n\n"
+ "Extraction Rules:\n"
+ "- Define the bond type (Single, Double, Aromatic, etc.) between a source and target atom.\n"
+ "- Precisely identify the spatial position or stereochemical orientation (e.g., Axial, Equatorial, Cis, Trans).\n"
+ "- Only create bonds between atoms that are present in the provided atom list.\n"
+ "- Capture bond lengths if numerical data is provided."
)
# ==============================================================================
diff --git a/hyperextract/templates/en/chemistry/protocol.py b/hyperextract/templates/en/chemistry/protocol.py
index 57f0ea1..f0fc98a 100644
--- a/hyperextract/templates/en/chemistry/protocol.py
+++ b/hyperextract/templates/en/chemistry/protocol.py
@@ -42,11 +42,21 @@ PROTOCOL_CONSOLIDATED_PROMPT = (
)
PROTOCOL_NODE_PROMPT = (
- "Identify individual laboratory operations, actions, and the equipment/reagents used for each."
+ "You are a laboratory technician. Your task is to identify individual protocol operations (Nodes).\n\n"
+ "Extraction Rules:\n"
+ "- Identify discrete actions (e.g., Centrifuge, Incubate, Titrate).\n"
+ "- Note the equipment used and any reagents added during that specific step.\n"
+ "- Capture safety precautions associated with the operation.\n"
+ "- DO NOT establish the sequence or timing between steps at this stage."
)
PROTOCOL_EDGE_PROMPT = (
- "Track the chronological flow between these operations. Identify the time elapsed or conditions required to move between steps."
+ "You are a laboratory technician. Given the list of laboratory operations, extract the sequential flow (Edges).\n\n"
+ "Extraction Rules:\n"
+ "- Connect the source step to the target step in chronological order.\n"
+ "- Identify the duration of the transition and the specific timestamp or sequence number.\n"
+ "- Record any wait conditions required before moving to the next operation.\n"
+ "- Only reference operations that exist in the provided operations list."
)
# ==============================================================================
diff --git a/hyperextract/templates/en/chemistry/reaction.py b/hyperextract/templates/en/chemistry/reaction.py
index cd74958..5ac119f 100644
--- a/hyperextract/templates/en/chemistry/reaction.py
+++ b/hyperextract/templates/en/chemistry/reaction.py
@@ -43,12 +43,21 @@ REACTION_CONSOLIDATED_PROMPT = (
)
REACTION_NODE_PROMPT = (
- "Identify all chemical entities mentioned. Look for IUPAC names, formulas, and CAS numbers."
+ "You are an organic chemist. Your task is to identify and extract all chemical entities (Nodes) mentioned in the text.\n\n"
+ "Extraction Rules:\n"
+ "- Identify reagents, products, catalysts, and solvents.\n"
+ "- Capture IUPAC names, chemical formulas, and CAS numbers where available.\n"
+ "- Note the physical phase (Gas, Liquid, Solid) of each entity.\n"
+ "- DO NOT construct reaction sequences or grouping participants at this stage."
)
REACTION_EDGE_PROMPT = (
- "Map reactions involving these chemicals. Group all participants into single reaction hyperedges. "
- "Ensure reactants and products are clearly distinguished."
+ "You are an organic chemist. Given the list of chemical entities, extract multi-component reaction events (Hyperedges).\n\n"
+ "Extraction Rules:\n"
+ "- Group all participants (reactants, products, catalysts, solvents) into a single reaction hyperedge.\n"
+ "- Clearly specify the roles (Reactant vs. Product) for each involved entity in the metadata.\n"
+ "- Only include entities that are present in the provided entity list.\n"
+ "- Capture specific conditions like temperature, pressure, and yield info for the reaction event."
)
# ==============================================================================
diff --git a/hyperextract/templates/zh/agriculture/crop_cycle.py b/hyperextract/templates/zh/agriculture/crop_cycle.py
index fd979c5..17e71b4 100644
--- a/hyperextract/templates/zh/agriculture/crop_cycle.py
+++ b/hyperextract/templates/zh/agriculture/crop_cycle.py
@@ -38,11 +38,22 @@ CROP_CYCLE_PROMPT = (
)
CROP_CYCLE_NODE_PROMPT = (
- "请提取关键农业组成要素:作物类型、生长阶段、环境条件(土壤/pH值/温度)、农事任务以及生物逆境(病虫害/真菌)。为每一项提供清晰的类别。"
+ "你是一位资深农艺师。你的任务是从文本中识别并提取所有关键农业实体(节点)。\n\n"
+ "提取规则:\n"
+ "- 识别作物类型、具体生长阶段、环境因子(如 pH 值、温度)以及农事任务。\n"
+ "- 捕捉生物逆境,如具体的病虫害、真菌或疾病。\n"
+ "- 将每个节点归入适当的类别:'作物'、'生长阶段'、'农事活动'等。\n"
+ "- 在此阶段请勿识别这些实体之间的逻辑顺序或依赖关系。"
)
CROP_CYCLE_EDGE_PROMPT = (
- "在作物周期中建立逻辑链路。按顺序连接生长阶段,将农事任务关联到其所属的阶段,并将环境要求映射到它们影响的实体上。使用'需要'、'抑制'等具体的对应关系类型。"
+ "你是一位资深农艺师。根据农业实体清单,映射其中的逻辑链路和周期关系(边)。\n\n"
+ "提取规则:\n"
+ "- 在生长阶段之间建立顺序链接。\n"
+ "- 将农事任务关联到必须执行它们的具体生长阶段上。\n"
+ "- 映射环境条件和病虫害如何影响作物及其生长阶段。\n"
+ "- 使用特定的关系类型,如 '处于阶段'、'需要操作'、'抑制' 或 '施用于'。\n"
+ "- 仅连接提供的农业实体清单中存在的实体。"
)
# ==============================================================================
diff --git a/hyperextract/templates/zh/biology/metabolic.py b/hyperextract/templates/zh/biology/metabolic.py
index 097fc64..01a5cf2 100644
--- a/hyperextract/templates/zh/biology/metabolic.py
+++ b/hyperextract/templates/zh/biology/metabolic.py
@@ -41,11 +41,21 @@ METABOLIC_CONSOLIDATED_PROMPT = (
)
METABOLIC_NODE_PROMPT = (
- "识别所有化学物质(代谢物)和酶。专注于精确的命名。"
+ "你是一位生物化学家。你的任务是识别代谢过程中涉及的所有代谢物和催化酶(节点)。\n\n"
+ "提取规则:\n"
+ "- 识别化学组分(底物/产物)以及促进其转化的酶。\n"
+ "- 如果有描述,请捕捉其化学式、电荷和细胞定位。\n"
+ "- 确保名称是标准化的(如:'6-磷酸葡萄糖')。\n"
+ "- 在此阶段请勿构建反应方程式或复合物。"
)
METABOLIC_EDGE_PROMPT = (
- "定义代表代谢反应的超边。包含每个识别出的反应事件中所有的代谢物和酶参与者。"
+ "你是一位生物化学家。根据以下代谢物和酶的清单,提取复杂的代谢反应(超边)。\n\n"
+ "提取规则:\n"
+ "- 将所有参与者(底物、产物和酶)归入单个反应事件中。\n"
+ "- 在反应元数据中清晰区分底物(输入)和产物(输出)。\n"
+ "- 仅包含已提供的实体清单中存在的参与者。\n"
+ "- 如果有具体数据,记录其化学计量和可逆性。"
)
# ==============================================================================
diff --git a/hyperextract/templates/zh/biology/network.py b/hyperextract/templates/zh/biology/network.py
index a26a287..9e19f38 100644
--- a/hyperextract/templates/zh/biology/network.py
+++ b/hyperextract/templates/zh/biology/network.py
@@ -41,13 +41,21 @@ NETWORK_CONSOLIDATED_PROMPT = (
)
NETWORK_NODE_PROMPT = (
- "识别提及的所有基因、蛋白质和分子。尽可能将名称规范化为标准符号。"
- "忽略诸如 '该蛋白质' 或 '此分子' 之类的泛指词,除非它们指向特定的具名实体。"
+ "你是一位生物信息学专家。你的任务是识别出文本中提及的所有分子实体(节点)。\n\n"
+ "提取规则:\n"
+ "- 识别基因、蛋白质、RNA 和代谢物。使用标准命名法(如:HGNC 符号)。\n"
+ "- 捕捉可用的别名和生物学功能。\n"
+ "- 排除通用的生物学词汇,除非它们作为已知分子的特定占位符。\n"
+ "- 在此阶段请勿提取相互作用或状态变化。"
)
NETWORK_EDGE_PROMPT = (
- "提取已识别生物实体之间的功能性和物理性相互作用。"
- "定义相互作用的方向和性质(激活、抑制等)。"
+ "你是一位生物信息学专家。根据以下分子实体清单,提取它们之间的物理和功能相互作用(边)。\n\n"
+ "提取规则:\n"
+ "- 识别相互作用的类型(磷酸化、抑制、激活、结合等)。\n"
+ "- 指定方向性(源实体作用于目标实体)。\n"
+ "- 仅在已提供的实体清单中的成员之间建立边。\n"
+ "- 如果提及,请包含生化机制和相互作用强度。"
)
# ==============================================================================
diff --git a/hyperextract/templates/zh/biology/taxonomy.py b/hyperextract/templates/zh/biology/taxonomy.py
index 20a6930..a4894cb 100644
--- a/hyperextract/templates/zh/biology/taxonomy.py
+++ b/hyperextract/templates/zh/biology/taxonomy.py
@@ -39,13 +39,21 @@ TAXONOMY_CONSOLIDATED_PROMPT = (
)
TAXONOMY_NODE_PROMPT = (
- "提取所有生物分类群(节点)。识别它们的等级(例如:科:人科)。"
- "专注于正式分类,排除临时或非标准的分类。"
+ "你是一位专业的分类学家。你的任务是从文本中识别并提取所有生物分类单元(节点)。\n\n"
+ "提取规则:\n"
+ "- 为每个分类单元识别其学名和指定的等级(如:域、界、门、纲、目、科、属、种)。\n"
+ "- 捕捉通用名称和简要描述(如果提供)。\n"
+ "- 仅专注于正式的生物分类。\n"
+ "- 在此阶段请勿提取分类单元之间的关系。"
)
TAXONOMY_EDGE_PROMPT = (
- "映射所提供的分类单元的谱系。创建反映系统发育演化或分类树的边。"
- "确保源节点的等级高于或等于目标节点的等级。"
+ "你是一位专业的分类学家。根据以下已识别分类单元的清单,提取文本中描述的层级关系(边)。\n\n"
+ "提取规则:\n"
+ "- 在高层级分类单元包含低层级分类单元时建立 'parent_of' 链接。\n"
+ "- 确保谱系准确反映文本中描述的系统发育或系统分类树。\n"
+ "- 仅连接已提供的分类单元清单中存在的节点。\n"
+ "- 使用提及的任何证据或基因组背景来补充关系。"
)
# ==============================================================================
diff --git a/hyperextract/templates/zh/business/ecosystem.py b/hyperextract/templates/zh/business/ecosystem.py
index b92f7b4..759d8e7 100644
--- a/hyperextract/templates/zh/business/ecosystem.py
+++ b/hyperextract/templates/zh/business/ecosystem.py
@@ -38,11 +38,21 @@ ECOSYSTEM_CONSOLIDATED_PROMPT = (
)
ECOSYSTEM_NODE_PROMPT = (
- "识别生态系统中的所有业务和监管参与者。记录它们的市场地位核心技术重点。"
+ "你是一位市场分析师。你的任务是识别产业生态系统中的所有参与者(节点)。\n\n"
+ "提取规则:\n"
+ "- 识别提及的公司、非政府组织(NGO)和监管机构。\n"
+ "- 捕捉它们的市场地位(Rank)和主要技术关注领域。\n"
+ "- 侧重于识别那些以群体形式进行合作或竞争的角色。\n"
+ "- 在此阶段请勿识别联盟、合资企业或财团。"
)
ECOSYSTEM_EDGE_PROMPT = (
- "提取集体联盟。将参与实体分组为集群(超边)。专注于财团、标准制定机构和联合市场行动。"
+ "你是一位市场分析师。根据产业参与者清单,提取集体关系(超边)。\n\n"
+ "提取规则:\n"
+ "- 将多个参与者(3个或更多)归入联盟、标准制定机构或合资企业。\n"
+ "- 为整个群体定义共同的目标(如:'研发'、'反垄断审查')。\n"
+ "- 记录提及的任何治理结构或领导参与者。\n"
+ "- 确保群体的每个成员都选自提供的参与者清单。"
)
# ==============================================================================
diff --git a/hyperextract/templates/zh/business/equity.py b/hyperextract/templates/zh/business/equity.py
index a0b7f24..814a940 100644
--- a/hyperextract/templates/zh/business/equity.py
+++ b/hyperextract/templates/zh/business/equity.py
@@ -40,11 +40,21 @@ EQUITY_CONSOLIDATED_PROMPT = (
)
EQUITY_NODE_PROMPT = (
- "在股权背景下提取提及的所有公司、投资基金和个人。将他们分类为 '自然人'、'私有公司' 等。"
+ "你是一位企业法务助理和财务分析师。你的任务是识别出公司结构中的所有利益相关者(节点)。\n\n"
+ "提取规则:\n"
+ "- 识别公司、投资基金、政府机构和自然人个人。\n"
+ "- 将其分类为 '自然人'、'上市公司'、'私有公司' 等。\n"
+ "- 在明确的情况下,标记被识别为最终受益人(UBO)的实体。\n"
+ "- 在此阶段请勿提取持股比例或控制联系。"
)
EQUITY_EDGE_PROMPT = (
- "构建所有权边。捕获股权比例和特定的控制类型。识别从股东到目标实体的资金或控制流向。"
+ "你是一位企业法务助理和财务分析师。根据利益相关者清单,映射所有权和控制关系(边)。\n\n"
+ "提取规则:\n"
+ "- 提取股东(源)与公司(目标)之间持有的确切股份比例。\n"
+ "- 指定控制的性质(如:投票权、直接控制、代持股份)。\n"
+ "- 仅在提供的利益相关者清单中的成员之间建立边。\n"
+ "- 捕获所有权记录的 '截至日期' 或历史时期。"
)
# ==============================================================================
diff --git a/hyperextract/templates/zh/business/strategy.py b/hyperextract/templates/zh/business/strategy.py
index 4df6bdd..78100ba 100644
--- a/hyperextract/templates/zh/business/strategy.py
+++ b/hyperextract/templates/zh/business/strategy.py
@@ -40,12 +40,21 @@ STRATEGY_CONSOLIDATED_PROMPT = (
)
STRATEGY_NODE_PROMPT = (
- "提取业务部门、产品线和高层公司目标。识别它们的组织重要性。"
+ "你是一位管理顾问。你的任务是识别战略实体和目标(节点)。\n\n"
+ "提取规则:\n"
+ "- 识别业务部门、特定产品以及公司高层目标(如:'可持续发展')。\n"
+ "- 确定每个单元的范围和组织重要性。\n"
+ "- 专注于代表战略重点领域的名词和名词短语。\n"
+ "- 在此阶段请勿提取战略性动作或转型。"
)
STRATEGY_EDGE_PROMPT = (
- "映射随时间推移的战略转变。确保 'timestamp' 被解析为具体时段。"
- "识别公司从什么(source)转向了什么(target)。"
+ "你是一位管理顾问。根据已识别的战略单元,映射战略随时间推移的转变(边)。\n\n"
+ "提取规则:\n"
+ "- 提取 '转型 (Pivots)' 以及如 '收购'、'剥离' 或 '关停' 之类的动作。\n"
+ "- 将源(旧重点)与目标(新重点)通过精确的时间戳联系起来。\n"
+ "- 捕捉深层原因以及提及的任何财务承诺(预算)。\n"
+ "- 仅引用战略单元清单中存在的节点。"
)
# ==============================================================================
diff --git a/hyperextract/templates/zh/chemistry/molecular.py b/hyperextract/templates/zh/chemistry/molecular.py
index ddeeb53..62b9fb3 100644
--- a/hyperextract/templates/zh/chemistry/molecular.py
+++ b/hyperextract/templates/zh/chemistry/molecular.py
@@ -40,11 +40,21 @@ MOLECULAR_CONSOLIDATED_PROMPT = (
)
MOLECULAR_NODE_PROMPT = (
- "提取所有单个原子。记录它们的元素类型和电子杂化状态。"
+ "你是一位计算化学家。你的任务是从分子结构中识别并提取所有单个原子(节点)。\n\n"
+ "提取规则:\n"
+ "- 识别唯一的原子标识符(如:C1)及其化学元素符号。\n"
+ "- 捕捉每个原子的电子杂化状态(sp, sp2, sp3)和形式电荷。\n"
+ "- 专注于保持源文本中出现的准确命名方式。\n"
+ "- 在此阶段请勿识别化学键或空间连接性。"
)
MOLECULAR_EDGE_PROMPT = (
- "映射原子间的连接性(化学键)。特别识别分子框架内发生连接的空间位置。"
+ "你是一位计算化学家。根据原子清单,映射化学键和空间连接性(边)。\n\n"
+ "提取规则:\n"
+ "- 定义源原子与目标原子之间的化学键类型(单键、双键、芳香键等)。\n"
+ "- 精确识别空间位置或立体化学取向(如:轴向、赤道向、顺式、反式)。\n"
+ "- 仅在提供的原子清单中存在的原子之间建立化学键。\n"
+ "- 如果提供了数值数据,请捕捉键长。"
)
# ==============================================================================
diff --git a/hyperextract/templates/zh/chemistry/protocol.py b/hyperextract/templates/zh/chemistry/protocol.py
index 5cb4ff9..d8478b8 100644
--- a/hyperextract/templates/zh/chemistry/protocol.py
+++ b/hyperextract/templates/zh/chemistry/protocol.py
@@ -42,11 +42,21 @@ PROTOCOL_CONSOLIDATED_PROMPT = (
)
PROTOCOL_NODE_PROMPT = (
- "识别具体的实验室操作、动作以及每个环节使用的设备/试剂。"
+ "你是一位实验室技术员。你的任务是识别出单个实验方案操作(节点)。\n\n"
+ "提取规则:\n"
+ "- 识别离散的动作(如:离心、孵育、滴定)。\n"
+ "- 记录使用的设备以及在该特定步骤中添加的任何试剂。\n"
+ "- 捕捉与该操作相关的安全预防措施。\n"
+ "- 在此阶段请勿建立步骤之间的顺序或时间关系。"
)
PROTOCOL_EDGE_PROMPT = (
- "跟踪这些操作之间的按时间顺序的流向。识别步骤转换之间经过的时间或所需的条件。"
+ "你是一位实验室技术员。根据实验室操作清单,提取顺序流向(边)。\n\n"
+ "提取规则:\n"
+ "- 按时间顺序将源步骤连接到目标步骤。\n"
+ "- 识别转换的持续时间以及特定的时间戳或顺序编号。\n"
+ "- 记录在进入下一步操作之前所需的任何等待条件。\n"
+ "- 仅引用提供的操作清单中存在的操作。"
)
# ==============================================================================
diff --git a/hyperextract/templates/zh/chemistry/reaction.py b/hyperextract/templates/zh/chemistry/reaction.py
index 5bb3809..ecf77f7 100644
--- a/hyperextract/templates/zh/chemistry/reaction.py
+++ b/hyperextract/templates/zh/chemistry/reaction.py
@@ -43,11 +43,21 @@ REACTION_CONSOLIDATED_PROMPT = (
)
REACTION_NODE_PROMPT = (
- "识别提及的所有化学实体。查找 IUPAC 名称、化学式和 CAS 号。"
+ "你是一位有机化学家。你的任务是识别出文本中提及的所有化学实体(节点)。\n\n"
+ "提取规则:\n"
+ "- 识别反应试剂、产物、催化剂和溶剂。\n"
+ "- 在可用时捕捉 IUPAC 名称、化学式和 CAS 号。\n"
+ "- 记录每个实体的物理状态(气态、液态、固态)。\n"
+ "- 在此阶段请勿构建反应序列或对参与者进行分组。"
)
REACTION_EDGE_PROMPT = (
- "映射涉及这些化学物质的反应。将所有参与者归入单个反应超边中。确保清晰地区分反应物和产物。"
+ "你是一位有机化学家。根据化学实体清单,提取多组分反应事件(超边)。\n\n"
+ "提取规则:\n"
+ "- 将所有参与者(反应物、产物、催化剂、溶剂)归入单个反应超边中。\n"
+ "- 在元数据中清晰指定每个相关实体的角色(反应物与产物)。\n"
+ "- 仅包含已提供的实体清单中存在的实体。\n"
+ "- 捕捉反应事件的特定条件,如温度、压力和产率信息。"
)
# ==============================================================================