Hypergraph is more powerful. Transform unstructured text into structured knowledge with LLMs. Graphs, hypergraphs, and spatio-temporal extractions — with one command.
refactor(templates): 统一提取指南字段名从extraction_guide改为guide
yifanfeng97d2260a472805
diff --git a/examples/config_template_demo.py b/examples/config_template_demo.pyindex ac004f4..e3bffdb 100644--- a/examples/config_template_demo.py+++ b/examples/config_template_demo.py@@ -20,7 +20,7 @@ from hyperextract.utils.template_engine import Gallery, TemplateFactoryfrom langchain_openai import ChatOpenAI, OpenAIEmbeddings-TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "fixtures" / "test_samples" / "zh" / "general"+TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "test_data" / "test_samples" / "zh" / "general"INPUT_FILE = TEST_SAMPLES_ROOT / "biography_scientist.md"diff --git a/examples/template_finance_demo.py b/examples/template_finance_demo.pyindex 7f0ef83..e088689 100644--- a/examples/template_finance_demo.py+++ b/examples/template_finance_demo.py@@ -60,7 +60,7 @@ from langchain_openai import ChatOpenAI, OpenAIEmbeddings# ==========================================# 测试文件根目录-TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "fixtures" / "test_samples" / "zh" / "finance"+TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "test_data" / "test_samples" / "zh" / "finance"# 模板到输入文件的映射关系TEMPLATE_TO_INPUT = {diff --git a/examples/template_general_demo.py b/examples/template_general_demo.pyindex 4fa01b5..b1e461a 100644--- a/examples/template_general_demo.py+++ b/examples/template_general_demo.py@@ -50,7 +50,7 @@ from langchain_openai import ChatOpenAI, OpenAIEmbeddings# ==========================================# 测试文件根目录-TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "fixtures" / "test_samples" / "zh" / "general"+TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "test_data" / "test_samples" / "zh" / "general"# 模板到输入文件的映射关系(根据 README 中的典型应用场景)TEMPLATE_TO_INPUT = {diff --git a/examples/template_industry_demo.py b/examples/template_industry_demo.pyindex 9caa3b3..8dc1fa2 100644--- a/examples/template_industry_demo.py+++ b/examples/template_industry_demo.py@@ -54,7 +54,7 @@ from langchain_openai import ChatOpenAI, OpenAIEmbeddingsTEST_SAMPLES_ROOT = (Path(__file__).parent.parent/ "tests"- / "fixtures"+ / "test_data"/ "test_samples"/ "zh"/ "industry"diff --git a/examples/template_legal_demo.py b/examples/template_legal_demo.pyindex 9d34e38..c75a0e6 100644--- a/examples/template_legal_demo.py+++ b/examples/template_legal_demo.py@@ -45,7 +45,7 @@ from langchain_openai import ChatOpenAI, OpenAIEmbeddings# ==========================================# 测试文件根目录-TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "fixtures" / "test_samples" / "zh" / "legal"+TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "test_data" / "test_samples" / "zh" / "legal"# 模板到输入文件的映射关系TEMPLATE_TO_INPUT = {diff --git a/examples/template_medicine_demo.py b/examples/template_medicine_demo.pyindex 2e84c45..cfae9aa 100644--- a/examples/template_medicine_demo.py+++ b/examples/template_medicine_demo.py@@ -52,7 +52,7 @@ from langchain_openai import ChatOpenAI, OpenAIEmbeddings# ==========================================# 测试文件根目录-TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "fixtures" / "test_samples" / "zh" / "medicine"+TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "test_data" / "test_samples" / "zh" / "medicine"# 模板到输入文件的映射关系(根据 README 中的典型应用场景)TEMPLATE_TO_INPUT = {diff --git a/examples/template_tcm_demo.py b/examples/template_tcm_demo.pyindex 3ec5ca5..bbc3634 100644--- a/examples/template_tcm_demo.py+++ b/examples/template_tcm_demo.py@@ -45,7 +45,7 @@ from langchain_openai import ChatOpenAI, OpenAIEmbeddings# ==========================================# 测试文件根目录-TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "fixtures" / "test_samples" / "zh" / "tcm"+TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "test_data" / "test_samples" / "zh" / "tcm"# 模板到输入文件的映射关系(根据 README 中的典型应用场景)TEMPLATE_TO_INPUT = {diff --git a/hyperextract/__init__.py b/hyperextract/__init__.pyindex 550c14e..33f4ead 100644--- a/hyperextract/__init__.py+++ b/hyperextract/__init__.py@@ -7,6 +7,16 @@ Architecture:- types: Core data structure primitives (AutoModel, AutoList, AutoSet, AutoGraph, etc.)- methods: Algorithms and strategies (rag, typical graph construction methods)- templates: Domain-specific extraction templates++Usage:+ from hyperextract import Template++ # Search templates+ Template.list()+ Template.search("知识图谱")++ # Create template (auto reads config from ~/.he/config.toml)+ template = Template.create("knowledge_graph")"""# Core AutoType primitives@@ -22,6 +32,10 @@ from .types import (AutoSpatioTemporalGraph,)+# Template engine API+from .utils.template_engine import Template++__version__ = "0.1.0"__author__ = "Yifan Feng"__email__ = "[email protected]"@@ -39,4 +53,6 @@ __all__ = ["AutoTemporalGraph","AutoSpatialGraph","AutoSpatioTemporalGraph",+ # Template engine+ "Template",]diff --git a/hyperextract/cli/config.py b/hyperextract/cli/config.pyindex 97e19db..81355fd 100644--- a/hyperextract/cli/config.py+++ b/hyperextract/cli/config.py@@ -2,6 +2,8 @@import osimport json+import tomllib+import tomli_wfrom pathlib import Pathfrom typing import Optional, Dict, Anyfrom dataclasses import dataclass@@ -79,11 +81,6 @@ class ConfigManager:if not self.config_path.exists():return- try:- import tomli as tomllib- except ImportError:- import tomllib-with open(self.config_path, "rb") as f:data = tomllib.load(f)@@ -96,9 +93,6 @@ class ConfigManager:"""Save configuration to file."""DEFAULT_CONFIG_DIR.mkdir(parents=True, exist_ok=True)- import tomli as tomllib- import tomli_w-data = {"llm": self.llm.to_dict(),"embedder": self.embedder.to_dict(),diff --git a/hyperextract/cli/templates.py b/hyperextract/cli/templates.pyindex 0f89bac..1951336 100644--- a/hyperextract/cli/templates.py+++ b/hyperextract/cli/templates.py@@ -2,114 +2,36 @@from typing import Optional, Any, Type-from hyperextract.utils.template_engine import Gallery, TemplateFactory, TemplateConfig+from hyperextract.utils.template_engine import Gallery, TemplateConfigdef resolve_template(template_str: str, lang: str = "zh") -> Type:- """- Resolve a template string to a template instance.-+ """Resolve a template string to a template instance.+Args:- template_str: Template name (e.g., "KnowledgeGraph", "zh/finance/risk_assessment")+ template_str: Template name (e.g., "knowledge_graph", "zh/finance/risk_assessment")lang: Language (zh/en)-+Returns:TemplateWrapper instance-+Raises:ValueError: If template not found"""- original_str = template_str-- config = Gallery.get(template_str)- if config is not None:- return _create_template_from_config(config)-- parts = template_str.split("/")- if len(parts) == 1:- template_name = parts[0]- search_name = f"{lang}/{template_name}"- config = Gallery.get(search_name)- if config is not None:- return _create_template_from_config(config)- else:- template_lang = parts[0]- if template_lang not in ["zh", "en"]:- template_lang = lang- template_name = parts[-1]-- full_name = f"{template_lang}/{template_name}"- config = Gallery.get(full_name)- if config is not None:- return _create_template_from_config(config)-- available = Gallery.list_all()- raise ValueError(f"Template '{original_str}' not found. Available templates: {available[:10]}...")+ return Gallery.create(template_str, lang)def resolve_template_config(template_str: str, lang: str = "zh") -> Optional[TemplateConfig]:- """- Resolve a template string to a TemplateConfig.-+ """Resolve a template string to a TemplateConfig.+Args:template_str: Template namelang: Language (zh/en)-+Returns:TemplateConfig if found, None otherwise"""- original_str = template_str-- config = Gallery.get(template_str)- if config is not None:- return config-- parts = template_str.split("/")- if len(parts) == 1:- template_name = parts[0]- search_name = f"{lang}/{template_name}"- config = Gallery.get(search_name)- if config is not None:- return config- else:- template_lang = parts[0]- if template_lang not in ["zh", "en"]:- template_lang = lang- template_name = parts[-1]- full_name = f"{template_lang}/{template_name}"- return Gallery.get(full_name)---def _create_template_from_config(config: TemplateConfig):- """Create a template instance from config using TemplateFactory."""- from .config import ConfigManager-- config_manager = ConfigManager()- llm_config = config_manager.get_llm_config()- embedder_config = config_manager.get_embedder_config()-- if llm_config.provider == "openai":- from langchain_openai import ChatOpenAI- llm_client = ChatOpenAI(- model=llm_config.model,- api_key=llm_config.api_key,- base_url=llm_config.base_url or None,- temperature=0,- )- else:- raise ValueError(f"Unsupported LLM provider: {llm_config.provider}")-- if embedder_config.provider == "openai":- from langchain_openai import OpenAIEmbeddings- embedder = OpenAIEmbeddings(- model=embedder_config.model,- api_key=embedder_config.api_key,- base_url=embedder_config.base_url or None,- )- else:- raise ValueError(f"Unsupported Embedder provider: {embedder_config.provider}")-- return TemplateFactory.create(config, llm_client, embedder)+ return Gallery._resolve_config(template_str, lang)def get_auto_type_from_template(template_or_config: Any) -> str:diff --git a/hyperextract/templates/legacy/examples/template_agriculture_demo.py b/hyperextract/templates/legacy/examples/template_agriculture_demo.pyindex 77081bd..57670d3 100644--- a/hyperextract/templates/legacy/examples/template_agriculture_demo.py+++ b/hyperextract/templates/legacy/examples/template_agriculture_demo.py@@ -39,7 +39,7 @@ from langchain_openai import ChatOpenAI, OpenAIEmbeddings# ==========================================# 测试文件根目录-TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "fixtures" / "test_samples" / "zh" / "agriculture"+TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "test_data" / "test_samples" / "zh" / "agriculture"# 模板到输入文件的映射关系(根据 README 中的典型应用场景)TEMPLATE_TO_INPUT = {diff --git a/hyperextract/templates/legacy/examples/template_biology_demo.py b/hyperextract/templates/legacy/examples/template_biology_demo.pyindex 76754fe..5d8629b 100644--- a/hyperextract/templates/legacy/examples/template_biology_demo.py+++ b/hyperextract/templates/legacy/examples/template_biology_demo.py@@ -43,7 +43,7 @@ from langchain_openai import ChatOpenAI, OpenAIEmbeddings# ==========================================# 测试文件根目录-TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "fixtures" / "test_samples" / "zh" / "biology"+TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "test_data" / "test_samples" / "zh" / "biology"# 模板到输入文件的映射关系(根据 README 中的典型应用场景)TEMPLATE_TO_INPUT = {diff --git a/hyperextract/templates/legacy/examples/template_food_demo.py b/hyperextract/templates/legacy/examples/template_food_demo.pyindex 10a12ca..be31021 100644--- a/hyperextract/templates/legacy/examples/template_food_demo.py+++ b/hyperextract/templates/legacy/examples/template_food_demo.py@@ -38,7 +38,7 @@ from langchain_openai import ChatOpenAI, OpenAIEmbeddings# ==========================================# 测试文件根目录-TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "fixtures" / "test_samples" / "zh" / "food"+TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "test_data" / "test_samples" / "zh" / "food"# 模板到输入文件的映射关系(根据 README 中的典型应用场景)TEMPLATE_TO_INPUT = {diff --git a/hyperextract/templates/legacy/examples/template_history_demo.py b/hyperextract/templates/legacy/examples/template_history_demo.pyindex 525815d..df08710 100644--- a/hyperextract/templates/legacy/examples/template_history_demo.py+++ b/hyperextract/templates/legacy/examples/template_history_demo.py@@ -44,7 +44,7 @@ from langchain_openai import ChatOpenAI, OpenAIEmbeddings# ==========================================# 测试文件根目录-TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "fixtures" / "test_samples" / "zh" / "history"+TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "test_data" / "test_samples" / "zh" / "history"# 模板到输入文件的映射关系(根据 README 中的典型应用场景)TEMPLATE_TO_INPUT = {diff --git a/hyperextract/templates/legacy/examples/template_literature_demo.py b/hyperextract/templates/legacy/examples/template_literature_demo.pyindex 8e3e348..ddd18e2 100644--- a/hyperextract/templates/legacy/examples/template_literature_demo.py+++ b/hyperextract/templates/legacy/examples/template_literature_demo.py@@ -42,7 +42,7 @@ from langchain_openai import ChatOpenAI, OpenAIEmbeddings# ==========================================# 测试文件根目录-TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "fixtures" / "test_samples" / "zh" / "literature"+TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "test_data" / "test_samples" / "zh" / "literature"# 模板到输入文件的映射关系(根据 README 中的典型应用场景)TEMPLATE_TO_INPUT = {diff --git a/hyperextract/templates/legacy/examples/template_news_demo.py b/hyperextract/templates/legacy/examples/template_news_demo.pyindex bee275f..7b1fb46 100644--- a/hyperextract/templates/legacy/examples/template_news_demo.py+++ b/hyperextract/templates/legacy/examples/template_news_demo.py@@ -42,7 +42,7 @@ from langchain_openai import ChatOpenAI, OpenAIEmbeddings# ==========================================# 测试文件根目录-TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "fixtures" / "test_samples" / "zh" / "news"+TEST_SAMPLES_ROOT = Path(__file__).parent.parent / "tests" / "test_data" / "test_samples" / "zh" / "news"# 模板到输入文件的映射关系(根据 README 中的典型应用场景)TEMPLATE_TO_INPUT = {diff --git a/hyperextract/templates/legacy/presets/agriculture/amendment_plan.yaml b/hyperextract/templates/legacy/presets/agriculture/amendment_plan.yamlindex e2a96a0..6bc4185 100644--- a/hyperextract/templates/legacy/presets/agriculture/amendment_plan.yaml+++ b/hyperextract/templates/legacy/presets/agriculture/amendment_plan.yaml@@ -41,7 +41,7 @@ edge_schema:description:zh: "详细描述"-extraction_guide:+guide:target:zh: |你是一位专业的土壤肥料专家,请从土壤改良方案报告中提取改良方案图。diff --git a/hyperextract/templates/legacy/presets/agriculture/crop_growth_cycle.yaml b/hyperextract/templates/legacy/presets/agriculture/crop_growth_cycle.yamlindex 38cf5bf..cbe6578 100644--- a/hyperextract/templates/legacy/presets/agriculture/crop_growth_cycle.yaml+++ b/hyperextract/templates/legacy/presets/agriculture/crop_growth_cycle.yaml@@ -41,7 +41,7 @@ edge_schema:description:zh: "关系描述"-extraction_guide:+guide:target:zh: |你是一位专业的农业技术专家,请从农业技术手册中提取作物生长周期图。diff --git a/hyperextract/templates/legacy/presets/agriculture/field_observation_list.yaml b/hyperextract/templates/legacy/presets/agriculture/field_observation_list.yamlindex 111454e..8230f30 100644--- a/hyperextract/templates/legacy/presets/agriculture/field_observation_list.yaml+++ b/hyperextract/templates/legacy/presets/agriculture/field_observation_list.yaml@@ -38,7 +38,7 @@ item_schema:description:zh: "建议措施列表"-extraction_guide:+guide:target:zh: |你是一位专业的农技人员,请从巡田报告中提取结构化的田间观测记录。diff --git a/hyperextract/templates/legacy/presets/agriculture/pest_control_hypergraph.yaml b/hyperextract/templates/legacy/presets/agriculture/pest_control_hypergraph.yamlindex 198ed24..bba7f4d 100644--- a/hyperextract/templates/legacy/presets/agriculture/pest_control_hypergraph.yaml+++ b/hyperextract/templates/legacy/presets/agriculture/pest_control_hypergraph.yaml@@ -49,7 +49,7 @@ edge_schema:description:zh: "安全间隔期"-extraction_guide:+guide:target:zh: |你是一位专业的植物保护专家,请从农业技术手册中提取病虫害防治超图。diff --git a/hyperextract/templates/legacy/presets/agriculture/soil_nutrient_model.yaml b/hyperextract/templates/legacy/presets/agriculture/soil_nutrient_model.yamlindex df97a3a..966c41f 100644--- a/hyperextract/templates/legacy/presets/agriculture/soil_nutrient_model.yaml+++ b/hyperextract/templates/legacy/presets/agriculture/soil_nutrient_model.yaml@@ -109,7 +109,7 @@ schema:zh: "有效硼含量,单位mg/kg"required: false-extraction_guide:+guide:target:zh: |你是一位专业的土壤肥料专家,请从土壤检测报告中提取土壤养分指标。diff --git a/hyperextract/templates/legacy/presets/biology/binding_site_model.yaml b/hyperextract/templates/legacy/presets/biology/binding_site_model.yamlindex c764c9c..0d8903c 100644--- a/hyperextract/templates/legacy/presets/biology/binding_site_model.yaml+++ b/hyperextract/templates/legacy/presets/biology/binding_site_model.yaml@@ -39,7 +39,7 @@ schema:zh: "配体信息,如结合的配体分子或药物"required: false-extraction_guide:+guide:target:zh: |你是一位专业的结构生物学专家,请从文本中提取蛋白质的关键位点信息。diff --git a/hyperextract/templates/legacy/presets/biology/biochemical_reaction_hypergraph.yaml b/hyperextract/templates/legacy/presets/biology/biochemical_reaction_hypergraph.yamlindex ad7c3cb..2c01e7c 100644--- a/hyperextract/templates/legacy/presets/biology/biochemical_reaction_hypergraph.yaml+++ b/hyperextract/templates/legacy/presets/biology/biochemical_reaction_hypergraph.yaml@@ -56,7 +56,7 @@ edge_schema:zh: "反应详细描述,包括反应条件或生物学意义"required: false-extraction_guide:+guide:target:zh: |你是一位专业的生物化学专家,请从代谢通路文献中提取生化分子及其反应关系。diff --git a/hyperextract/templates/legacy/presets/biology/biodiversity_registry.yaml b/hyperextract/templates/legacy/presets/biology/biodiversity_registry.yamlindex e635e98..33709bb 100644--- a/hyperextract/templates/legacy/presets/biology/biodiversity_registry.yaml+++ b/hyperextract/templates/legacy/presets/biology/biodiversity_registry.yaml@@ -42,7 +42,7 @@ item_schema:zh: "观测详情,包括观测时间、地点和数量记录"required: false-extraction_guide:+guide:target:zh: |你是一位专业的生态学专家,请从调查报告中提取所有物种观测记录,构建物种名录。diff --git a/hyperextract/templates/legacy/presets/biology/phylogenetic_relation_graph.yaml b/hyperextract/templates/legacy/presets/biology/phylogenetic_relation_graph.yamlindex c5f54d0..9607cd9 100644--- a/hyperextract/templates/legacy/presets/biology/phylogenetic_relation_graph.yaml+++ b/hyperextract/templates/legacy/presets/biology/phylogenetic_relation_graph.yaml@@ -53,7 +53,7 @@ edge_schema:zh: "详细描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的进化生物学专家,请从生物学文献中提取物种或分类单元及其系统发育关系。diff --git a/hyperextract/templates/legacy/presets/biology/protein_complex_map.yaml b/hyperextract/templates/legacy/presets/biology/protein_complex_map.yamlindex e20a98b..5f19a84 100644--- a/hyperextract/templates/legacy/presets/biology/protein_complex_map.yaml+++ b/hyperextract/templates/legacy/presets/biology/protein_complex_map.yaml@@ -48,7 +48,7 @@ edge_schema:zh: "组装细节,如哪些亚基相互作用"required: false-extraction_guide:+guide:target:zh: |你是一位专业的结构生物学专家,请从蛋白质结构文献中提取蛋白质及其复合物组成关系。diff --git a/hyperextract/templates/legacy/presets/biology/regulatory_network.yaml b/hyperextract/templates/legacy/presets/biology/regulatory_network.yamlindex 7d77eb7..36455e7 100644--- a/hyperextract/templates/legacy/presets/biology/regulatory_network.yaml+++ b/hyperextract/templates/legacy/presets/biology/regulatory_network.yaml@@ -53,7 +53,7 @@ edge_schema:zh: "详细描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的分子生物学专家,请从文本中提取基因、转录因子及其之间的调控关系。diff --git a/hyperextract/templates/legacy/presets/biology/species_interaction_web.yaml b/hyperextract/templates/legacy/presets/biology/species_interaction_web.yamlindex 01f4c87..115b951 100644--- a/hyperextract/templates/legacy/presets/biology/species_interaction_web.yaml+++ b/hyperextract/templates/legacy/presets/biology/species_interaction_web.yaml@@ -47,7 +47,7 @@ edge_schema:zh: "关系详细描述,包括具体行为或机制"required: false-extraction_guide:+guide:target:zh: |你是一位专业的生态学专家,请从文本中提取物种及其之间的相互作用关系。diff --git a/hyperextract/templates/legacy/presets/biology/taxonomic_tree.yaml b/hyperextract/templates/legacy/presets/biology/taxonomic_tree.yamlindex 7c30c04..11dc4dc 100644--- a/hyperextract/templates/legacy/presets/biology/taxonomic_tree.yaml+++ b/hyperextract/templates/legacy/presets/biology/taxonomic_tree.yaml@@ -43,7 +43,7 @@ edge_schema:zh: "详细描述,包含具体的分类路径信息"required: false-extraction_guide:+guide:target:zh: |你是一位专业的生物分类学专家,请从生物学文献中提取分类单元及其层级包含关系。diff --git a/hyperextract/templates/legacy/presets/food/dish_review_summary.yaml b/hyperextract/templates/legacy/presets/food/dish_review_summary.yamlindex 6e7f31a..bed2373 100644--- a/hyperextract/templates/legacy/presets/food/dish_review_summary.yaml+++ b/hyperextract/templates/legacy/presets/food/dish_review_summary.yaml@@ -46,7 +46,7 @@ item_schema:required: truedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的美食评论家,请从文本中提取每道菜品的核心评价信息,形成食评摘要清单。diff --git a/hyperextract/templates/legacy/presets/food/ingredient_composition_hypergraph.yaml b/hyperextract/templates/legacy/presets/food/ingredient_composition_hypergraph.yamlindex a5d4697..211c96f 100644--- a/hyperextract/templates/legacy/presets/food/ingredient_composition_hypergraph.yaml+++ b/hyperextract/templates/legacy/presets/food/ingredient_composition_hypergraph.yaml@@ -61,7 +61,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的烹饪大师,请从文本中提取菜品与食材的配伍关系,建模为超边结构。diff --git a/hyperextract/templates/legacy/presets/food/recipe_collection.yaml b/hyperextract/templates/legacy/presets/food/recipe_collection.yamlindex a6fbed8..3b8abc8 100644--- a/hyperextract/templates/legacy/presets/food/recipe_collection.yaml+++ b/hyperextract/templates/legacy/presets/food/recipe_collection.yaml@@ -34,7 +34,7 @@ item_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的餐饮知识专家,请从文本中提取所有独立菜品实体,形成菜谱名录。diff --git a/hyperextract/templates/legacy/presets/food/sensory_evaluation_graph.yaml b/hyperextract/templates/legacy/presets/food/sensory_evaluation_graph.yamlindex be67eb3..49eec98 100644--- a/hyperextract/templates/legacy/presets/food/sensory_evaluation_graph.yaml+++ b/hyperextract/templates/legacy/presets/food/sensory_evaluation_graph.yaml@@ -55,7 +55,7 @@ edge_schema:required: truedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的美食评论家,请从文本中提取感官评价图谱,包括菜品、口感/味道、食材/技法之间的归因关系。diff --git a/hyperextract/templates/legacy/presets/food/standard_recipe_card.yaml b/hyperextract/templates/legacy/presets/food/standard_recipe_card.yamlindex c541537..f12d3ae 100644--- a/hyperextract/templates/legacy/presets/food/standard_recipe_card.yaml+++ b/hyperextract/templates/legacy/presets/food/standard_recipe_card.yaml@@ -88,7 +88,7 @@ schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的烹饪大师,请从文本中提取单个菜品的完整标准食谱信息。diff --git a/hyperextract/templates/legacy/presets/history/chronological_event_chain.yaml b/hyperextract/templates/legacy/presets/history/chronological_event_chain.yamlindex aa17abc..3f09f89 100644--- a/hyperextract/templates/legacy/presets/history/chronological_event_chain.yaml+++ b/hyperextract/templates/legacy/presets/history/chronological_event_chain.yaml@@ -45,7 +45,7 @@ edge_schema:description:zh: "事件因果描述,说明两事件之间的逻辑关系"-extraction_guide:+guide:target:zh: |你是一位专业的历史学专家,请从文本中提取历史事件以及它们之间的时间因果关系。diff --git a/hyperextract/templates/legacy/presets/history/epistolary_knowledge_graph.yaml b/hyperextract/templates/legacy/presets/history/epistolary_knowledge_graph.yamlindex c224da3..8e783b4 100644--- a/hyperextract/templates/legacy/presets/history/epistolary_knowledge_graph.yaml+++ b/hyperextract/templates/legacy/presets/history/epistolary_knowledge_graph.yaml@@ -58,7 +58,7 @@ edge_schema:description:zh: "信件内容摘要"-extraction_guide:+guide:target:zh: |你是一位专业的历史学专家,请从文本中提取书信中的人物以及书信内容关系。diff --git a/hyperextract/templates/legacy/presets/history/historical_context_graph.yaml b/hyperextract/templates/legacy/presets/history/historical_context_graph.yamlindex b6d5bca..8fe656b 100644--- a/hyperextract/templates/legacy/presets/history/historical_context_graph.yaml+++ b/hyperextract/templates/legacy/presets/history/historical_context_graph.yaml@@ -41,7 +41,7 @@ edge_schema:description:zh: "关系描述"-extraction_guide:+guide:target:zh: |你是一位专业的历史学专家,请从文本中提取历史背景相关的实体以及它们之间的关系。diff --git a/hyperextract/templates/legacy/presets/history/historical_knowledge_graph.yaml b/hyperextract/templates/legacy/presets/history/historical_knowledge_graph.yamlindex d90e570..b7a63ba 100644--- a/hyperextract/templates/legacy/presets/history/historical_knowledge_graph.yaml+++ b/hyperextract/templates/legacy/presets/history/historical_knowledge_graph.yaml@@ -46,7 +46,7 @@ edge_schema:description:zh: "关系描述,描述两人之间的具体互动或关系详情"-extraction_guide:+guide:target:zh: |你是一位专业的历史学专家,请从文本中提取所有历史人物以及他们之间的关系。diff --git a/hyperextract/templates/legacy/presets/history/memory_flashback_list.yaml b/hyperextract/templates/legacy/presets/history/memory_flashback_list.yamlindex edcc639..9dcb70a 100644--- a/hyperextract/templates/legacy/presets/history/memory_flashback_list.yaml+++ b/hyperextract/templates/legacy/presets/history/memory_flashback_list.yaml@@ -38,7 +38,7 @@ item_schema:zh: "补充描述"required: false-extraction_guide:+guide:target:zh: |请从文本中提取口述历史或回忆录中的回忆片段。diff --git a/hyperextract/templates/legacy/presets/history/multi_participant_event_map.yaml b/hyperextract/templates/legacy/presets/history/multi_participant_event_map.yamlindex 9e1a66f..9c6af56 100644--- a/hyperextract/templates/legacy/presets/history/multi_participant_event_map.yaml+++ b/hyperextract/templates/legacy/presets/history/multi_participant_event_map.yaml@@ -51,7 +51,7 @@ edge_schema:description:zh: "参与者列表,与节点对应"-extraction_guide:+guide:target:zh: |你是一位专业的历史学专家,请从文本中提取历史事件中的参与者以及他们组成的事件超边。diff --git a/hyperextract/templates/legacy/presets/history/narrative_relation_graph.yaml b/hyperextract/templates/legacy/presets/history/narrative_relation_graph.yamlindex 5f0f7f7..3bcd26f 100644--- a/hyperextract/templates/legacy/presets/history/narrative_relation_graph.yaml+++ b/hyperextract/templates/legacy/presets/history/narrative_relation_graph.yaml@@ -42,7 +42,7 @@ edge_schema:description:zh: "互动内容或评价具体描述"-extraction_guide:+guide:target:zh: |你是一位专业的历史学专家,请从文本中提取口述历史或回忆录中的人物以及他们之间的互动与评价关系。diff --git a/hyperextract/templates/legacy/presets/history/personal_trajectory_hypergraph.yaml b/hyperextract/templates/legacy/presets/history/personal_trajectory_hypergraph.yamlindex 56c368d..7357daf 100644--- a/hyperextract/templates/legacy/presets/history/personal_trajectory_hypergraph.yaml+++ b/hyperextract/templates/legacy/presets/history/personal_trajectory_hypergraph.yaml@@ -48,7 +48,7 @@ edge_schema:zh: "阶段描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的历史学专家,请从文本中提取人物的人生阶段轨迹。diff --git a/hyperextract/templates/legacy/presets/history/political_struggle_hypergraph.yaml b/hyperextract/templates/legacy/presets/history/political_struggle_hypergraph.yamlindex b6d027f..c9d40c4 100644--- a/hyperextract/templates/legacy/presets/history/political_struggle_hypergraph.yaml+++ b/hyperextract/templates/legacy/presets/history/political_struggle_hypergraph.yaml@@ -64,7 +64,7 @@ edge_schema:description:zh: "结果描述"-extraction_guide:+guide:target:zh: |你是一位专业的历史学专家,请从文本中提取政治博弈或战役中的人物以及他们组成的博弈事件超边。diff --git a/hyperextract/templates/legacy/presets/literature/character_arc_timeline.yaml b/hyperextract/templates/legacy/presets/literature/character_arc_timeline.yamlindex 46d0e2e..217e2d5 100644--- a/hyperextract/templates/legacy/presets/literature/character_arc_timeline.yaml+++ b/hyperextract/templates/legacy/presets/literature/character_arc_timeline.yaml@@ -46,7 +46,7 @@ edge_schema:description:zh: "关系描述"-extraction_guide:+guide:target:zh: |你是一位专业的影视剧本分析师,请从文本中提取叙事元素以及它们之间的关系,构建异质图。diff --git a/hyperextract/templates/legacy/presets/literature/complex_character_relation.yaml b/hyperextract/templates/legacy/presets/literature/complex_character_relation.yamlindex 937fbd0..20e15e0 100644--- a/hyperextract/templates/legacy/presets/literature/complex_character_relation.yaml+++ b/hyperextract/templates/legacy/presets/literature/complex_character_relation.yaml@@ -47,7 +47,7 @@ edge_schema:zh: "来源情节"required: false-extraction_guide:+guide:target:zh: |你是一位专业的小说分析师,请从文本中提取人物以及它们之间的复杂关系超边。diff --git a/hyperextract/templates/legacy/presets/literature/critique_argument_hypergraph.yaml b/hyperextract/templates/legacy/presets/literature/critique_argument_hypergraph.yamlindex 22821dc..341c086 100644--- a/hyperextract/templates/legacy/presets/literature/critique_argument_hypergraph.yaml+++ b/hyperextract/templates/legacy/presets/literature/critique_argument_hypergraph.yaml@@ -47,7 +47,7 @@ edge_schema:description:zh: "论证描述"-extraction_guide:+guide:target:zh: |你是一位专业的文学评论家,请从文本中提取论证元素以及它们组成的论证超边。diff --git a/hyperextract/templates/legacy/presets/literature/motif_association_net.yaml b/hyperextract/templates/legacy/presets/literature/motif_association_net.yamlindex 8cdb797..5cd99ab 100644--- a/hyperextract/templates/legacy/presets/literature/motif_association_net.yaml+++ b/hyperextract/templates/legacy/presets/literature/motif_association_net.yaml@@ -37,7 +37,7 @@ edge_schema:description:zh: "关联描述"-extraction_guide:+guide:target:zh: |你是一位专业的文学评论家,请从文本中提取意象以及它们之间的关联关系。diff --git a/hyperextract/templates/legacy/presets/literature/narrative_event_chain.yaml b/hyperextract/templates/legacy/presets/literature/narrative_event_chain.yamlindex fab458e..31009df 100644--- a/hyperextract/templates/legacy/presets/literature/narrative_event_chain.yaml+++ b/hyperextract/templates/legacy/presets/literature/narrative_event_chain.yaml@@ -37,7 +37,7 @@ edge_schema:description:zh: "因果关系描述"-extraction_guide:+guide:target:zh: |你是一位专业的小说分析师,请从文本中提取情节转折点以及它们之间的因果关系。diff --git a/hyperextract/templates/legacy/presets/literature/narrative_structure_tree.yaml b/hyperextract/templates/legacy/presets/literature/narrative_structure_tree.yamlindex 010ab42..195c1e4 100644--- a/hyperextract/templates/legacy/presets/literature/narrative_structure_tree.yaml+++ b/hyperextract/templates/legacy/presets/literature/narrative_structure_tree.yaml@@ -41,7 +41,7 @@ edge_schema:description:zh: "描述"-extraction_guide:+guide:target:zh: |你是一位专业的文学评论家,请从文本中提取叙事结构单元以及它们之间的层级关系。diff --git a/hyperextract/templates/legacy/presets/literature/scene_event_hypergraph.yaml b/hyperextract/templates/legacy/presets/literature/scene_event_hypergraph.yamlindex 3b10629..46bf745 100644--- a/hyperextract/templates/legacy/presets/literature/scene_event_hypergraph.yaml+++ b/hyperextract/templates/legacy/presets/literature/scene_event_hypergraph.yaml@@ -50,7 +50,7 @@ edge_schema:description:zh: "时间段:日/夜/晨/昏"-extraction_guide:+guide:target:zh: |你是一位专业的影视剧本分析师,请从文本中提取场景元素以及它们组成的场景事件超边。diff --git a/hyperextract/templates/legacy/presets/literature/story_entity_graph.yaml b/hyperextract/templates/legacy/presets/literature/story_entity_graph.yamlindex 390659c..34fa693 100644--- a/hyperextract/templates/legacy/presets/literature/story_entity_graph.yaml+++ b/hyperextract/templates/legacy/presets/literature/story_entity_graph.yaml@@ -41,7 +41,7 @@ edge_schema:description:zh: "描述"-extraction_guide:+guide:target:zh: |你是一位专业的小说分析师,请从文本中提取故事实体以及它们之间的关系。diff --git a/hyperextract/templates/legacy/presets/news/complex_relation_net.yaml b/hyperextract/templates/legacy/presets/news/complex_relation_net.yamlindex 44be3c8..72162c2 100644--- a/hyperextract/templates/legacy/presets/news/complex_relation_net.yaml+++ b/hyperextract/templates/legacy/presets/news/complex_relation_net.yaml@@ -49,7 +49,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的新闻调查记者,请从调查报道文本中提取参与者以及它们之间的复杂关系。diff --git a/hyperextract/templates/legacy/presets/news/impact_chain.yaml b/hyperextract/templates/legacy/presets/news/impact_chain.yamlindex 0f840f6..f0df671 100644--- a/hyperextract/templates/legacy/presets/news/impact_chain.yaml+++ b/hyperextract/templates/legacy/presets/news/impact_chain.yaml@@ -55,7 +55,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的政策分析师,请从政策分析文本中提取影响链实体和它们之间的因果关系。diff --git a/hyperextract/templates/legacy/presets/news/investigative_context_graph.yaml b/hyperextract/templates/legacy/presets/news/investigative_context_graph.yamlindex 4c06288..fd8be49 100644--- a/hyperextract/templates/legacy/presets/news/investigative_context_graph.yaml+++ b/hyperextract/templates/legacy/presets/news/investigative_context_graph.yaml@@ -55,7 +55,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的新闻调查记者,请从调查报道文本中提取实体和它们之间的关系。diff --git a/hyperextract/templates/legacy/presets/news/key_event_sequence.yaml b/hyperextract/templates/legacy/presets/news/key_event_sequence.yamlindex 0f09b3a..1184d6c 100644--- a/hyperextract/templates/legacy/presets/news/key_event_sequence.yaml+++ b/hyperextract/templates/legacy/presets/news/key_event_sequence.yaml@@ -61,7 +61,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的新闻调查记者,请从调查报道文本中提取关键事件以及它们之间的关系。diff --git a/hyperextract/templates/legacy/presets/news/live_update_timeline.yaml b/hyperextract/templates/legacy/presets/news/live_update_timeline.yamlindex 611ea64..497e7e3 100644--- a/hyperextract/templates/legacy/presets/news/live_update_timeline.yaml+++ b/hyperextract/templates/legacy/presets/news/live_update_timeline.yaml@@ -61,7 +61,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的新闻直播编辑,请从实时直播文本中提取时间更新点以及它们之间的关系。diff --git a/hyperextract/templates/legacy/presets/news/news_entity_graph.yaml b/hyperextract/templates/legacy/presets/news/news_entity_graph.yamlindex 54f4936..97a3120 100644--- a/hyperextract/templates/legacy/presets/news/news_entity_graph.yaml+++ b/hyperextract/templates/legacy/presets/news/news_entity_graph.yaml@@ -55,7 +55,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的新闻编辑,请从新闻文本中提取实体和它们之间的动作或关系。diff --git a/hyperextract/templates/legacy/presets/news/news_summary_model.yaml b/hyperextract/templates/legacy/presets/news/news_summary_model.yamlindex bc3ca55..ea61545 100644--- a/hyperextract/templates/legacy/presets/news/news_summary_model.yaml+++ b/hyperextract/templates/legacy/presets/news/news_summary_model.yaml@@ -58,7 +58,7 @@ schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的新闻编辑,请从新闻文本中提取结构化的5W1H要素,构建新闻摘要。diff --git a/hyperextract/templates/legacy/presets/news/viewpoint_structure.yaml b/hyperextract/templates/legacy/presets/news/viewpoint_structure.yamlindex 4c3b1b2..73649c1 100644--- a/hyperextract/templates/legacy/presets/news/viewpoint_structure.yaml+++ b/hyperextract/templates/legacy/presets/news/viewpoint_structure.yaml@@ -55,7 +55,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的政策分析师,请从文本中提取论证元素以及它们组成的观点聚合超边。diff --git a/hyperextract/templates/presets/finance/call_sentiment_hypergraph.yaml b/hyperextract/templates/presets/finance/call_sentiment_hypergraph.yamlindex 3bb4c00..ac16c87 100644--- a/hyperextract/templates/presets/finance/call_sentiment_hypergraph.yaml+++ b/hyperextract/templates/presets/finance/call_sentiment_hypergraph.yaml@@ -67,7 +67,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的财报电话会议情绪分析师,请从文本中提取主题、发言人、情绪信号及其多维关系。diff --git a/hyperextract/templates/presets/finance/company_history_timeline.yaml b/hyperextract/templates/presets/finance/company_history_timeline.yamlindex 5be91ef..3a6a95c 100644--- a/hyperextract/templates/presets/finance/company_history_timeline.yaml+++ b/hyperextract/templates/presets/finance/company_history_timeline.yaml@@ -61,7 +61,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的公司历史分析师,请从文本中提取公司相关的实体以及里程碑事件。diff --git a/hyperextract/templates/presets/finance/discussion_graph.yaml b/hyperextract/templates/presets/finance/discussion_graph.yamlindex 4a3c50d..eb8b65a 100644--- a/hyperextract/templates/presets/finance/discussion_graph.yaml+++ b/hyperextract/templates/presets/finance/discussion_graph.yaml@@ -55,7 +55,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的财报会议分析师,请从文本中提取讨论中出现的实体以及它们之间的关系。diff --git a/hyperextract/templates/presets/finance/earnings_call_summary.yaml b/hyperextract/templates/presets/finance/earnings_call_summary.yamlindex f0e8c70..f9970fb 100644--- a/hyperextract/templates/presets/finance/earnings_call_summary.yaml+++ b/hyperextract/templates/presets/finance/earnings_call_summary.yaml@@ -106,7 +106,7 @@ schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的分析师,请从财报电话会议记录中提取关键财务指标、业绩指引和整体基调。diff --git a/hyperextract/templates/presets/finance/factor_influence_hypergraph.yaml b/hyperextract/templates/presets/finance/factor_influence_hypergraph.yamlindex 8a46336..7ce028b 100644--- a/hyperextract/templates/presets/finance/factor_influence_hypergraph.yaml+++ b/hyperextract/templates/presets/finance/factor_influence_hypergraph.yaml@@ -49,7 +49,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的金融多因子分析师,请从文本中提取因子(作为节点)和因子导致的结果(作为超边)。diff --git a/hyperextract/templates/presets/finance/filing_financial_snapshot.yaml b/hyperextract/templates/presets/finance/filing_financial_snapshot.yamlindex 3d222f5..efce097 100644--- a/hyperextract/templates/presets/finance/filing_financial_snapshot.yaml+++ b/hyperextract/templates/presets/finance/filing_financial_snapshot.yaml@@ -88,7 +88,7 @@ schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的财务分析师,请从 SEC 申报文件中提取关键财务数据。diff --git a/hyperextract/templates/presets/finance/filing_risk_factor_set.yaml b/hyperextract/templates/presets/finance/filing_risk_factor_set.yamlindex f1a6221..cc47a0a 100644--- a/hyperextract/templates/presets/finance/filing_risk_factor_set.yaml+++ b/hyperextract/templates/presets/finance/filing_risk_factor_set.yaml@@ -52,7 +52,7 @@ item_schema:required: falsedefault: false-extraction_guide:+guide:target:zh: |你是一位专业的监管申报分析师,请从 SEC 申报文件的风险因素章节中提取并归类所有单项风险因素。diff --git a/hyperextract/templates/presets/finance/financial_data_temporal_graph.yaml b/hyperextract/templates/presets/finance/financial_data_temporal_graph.yamlindex 5726874..75619c7 100644--- a/hyperextract/templates/presets/finance/financial_data_temporal_graph.yaml+++ b/hyperextract/templates/presets/finance/financial_data_temporal_graph.yaml@@ -61,7 +61,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的财务分析师,请从文本中提取财务实体及其跨时间的量化关系。diff --git a/hyperextract/templates/presets/finance/financial_forecast.yaml b/hyperextract/templates/presets/finance/financial_forecast.yamlindex 0c5e302..b8e0629 100644--- a/hyperextract/templates/presets/finance/financial_forecast.yaml+++ b/hyperextract/templates/presets/finance/financial_forecast.yaml@@ -58,7 +58,7 @@ item_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的金融分析师,请从文本中提取所有财务预测和估算。diff --git a/hyperextract/templates/presets/finance/management_guidance_list.yaml b/hyperextract/templates/presets/finance/management_guidance_list.yamlindex 5446e57..401c6f2 100644--- a/hyperextract/templates/presets/finance/management_guidance_list.yaml+++ b/hyperextract/templates/presets/finance/management_guidance_list.yaml@@ -58,7 +58,7 @@ item_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的分析师,请从财报电话会议记录中提取所有前瞻性声明和业绩指引。diff --git a/hyperextract/templates/presets/finance/market_narrative_timeline.yaml b/hyperextract/templates/presets/finance/market_narrative_timeline.yamlindex 0f258f8..05707a2 100644--- a/hyperextract/templates/presets/finance/market_narrative_timeline.yaml+++ b/hyperextract/templates/presets/finance/market_narrative_timeline.yaml@@ -61,7 +61,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的策略师,请从财经评论中提取市场叙事以及它们随时间的演变。diff --git a/hyperextract/templates/presets/finance/market_sentiment_model.yaml b/hyperextract/templates/presets/finance/market_sentiment_model.yamlindex abd98f2..188e831 100644--- a/hyperextract/templates/presets/finance/market_sentiment_model.yaml+++ b/hyperextract/templates/presets/finance/market_sentiment_model.yaml@@ -76,7 +76,7 @@ schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的金融情绪分析师,请从财经新闻文章或市场评论中提取情绪快照。diff --git a/hyperextract/templates/presets/finance/material_event_timeline.yaml b/hyperextract/templates/presets/finance/material_event_timeline.yamlindex 08bf315..b5e86d1 100644--- a/hyperextract/templates/presets/finance/material_event_timeline.yaml+++ b/hyperextract/templates/presets/finance/material_event_timeline.yaml@@ -73,7 +73,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的监管申报分析师,请从文本中提取参与重大事件的实体及其之间的时序关系。diff --git a/hyperextract/templates/presets/finance/multi_source_sentiment_hypergraph.yaml b/hyperextract/templates/presets/finance/multi_source_sentiment_hypergraph.yamlindex 618df62..dbedcad 100644--- a/hyperextract/templates/presets/finance/multi_source_sentiment_hypergraph.yaml+++ b/hyperextract/templates/presets/finance/multi_source_sentiment_hypergraph.yaml@@ -79,7 +79,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的多源情绪融合分析师,请从不同来源提取情绪信号并创建聚合情绪视图。diff --git a/hyperextract/templates/presets/finance/proceeds_usage.yaml b/hyperextract/templates/presets/finance/proceeds_usage.yamlindex 1393da0..0b9d6fa 100644--- a/hyperextract/templates/presets/finance/proceeds_usage.yaml+++ b/hyperextract/templates/presets/finance/proceeds_usage.yaml@@ -46,7 +46,7 @@ item_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的 IPO 分析师,请从招股说明书中提取所有募集资金用途分配信息。diff --git a/hyperextract/templates/presets/finance/research_note_summary.yaml b/hyperextract/templates/presets/finance/research_note_summary.yamlindex b549b28..6cfd53a 100644--- a/hyperextract/templates/presets/finance/research_note_summary.yaml+++ b/hyperextract/templates/presets/finance/research_note_summary.yaml@@ -100,7 +100,7 @@ schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的股票研究分析师,请从研究报告中提取核心投资论点、评级、目标价和关键论据。diff --git a/hyperextract/templates/presets/finance/risk_assessment.yaml b/hyperextract/templates/presets/finance/risk_assessment.yamlindex c50666f..19b6b3d 100644--- a/hyperextract/templates/presets/finance/risk_assessment.yaml+++ b/hyperextract/templates/presets/finance/risk_assessment.yaml@@ -73,7 +73,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的金融风险分析师,请从企业披露文件中提取风险因素、财务指标、运营结果等实体,以及它们之间的风险传导关系。diff --git a/hyperextract/templates/presets/finance/risk_factor_list.yaml b/hyperextract/templates/presets/finance/risk_factor_list.yamlindex 666eb3c..66a0466 100644--- a/hyperextract/templates/presets/finance/risk_factor_list.yaml+++ b/hyperextract/templates/presets/finance/risk_factor_list.yaml@@ -46,7 +46,7 @@ item_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的风险分析师,请从文本中提取所有下行风险和风险因素。diff --git a/hyperextract/templates/presets/finance/segment_performance_list.yaml b/hyperextract/templates/presets/finance/segment_performance_list.yamlindex f005959..dbf7271 100644--- a/hyperextract/templates/presets/finance/segment_performance_list.yaml+++ b/hyperextract/templates/presets/finance/segment_performance_list.yaml@@ -52,7 +52,7 @@ item_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的财务分析师,请从 SEC 申报文件中提取每个业务板块或地理区域的业绩数据。diff --git a/hyperextract/templates/presets/finance/shareholder_structure.yaml b/hyperextract/templates/presets/finance/shareholder_structure.yamlindex 8eba2f8..6d6b798 100644--- a/hyperextract/templates/presets/finance/shareholder_structure.yaml+++ b/hyperextract/templates/presets/finance/shareholder_structure.yaml@@ -67,7 +67,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的公司治理分析师,请从招股说明书或委托声明文件中提取股权结构。diff --git a/hyperextract/templates/presets/finance/supply_chain.yaml b/hyperextract/templates/presets/finance/supply_chain.yamlindex 6425da5..f4458f9 100644--- a/hyperextract/templates/presets/finance/supply_chain.yaml+++ b/hyperextract/templates/presets/finance/supply_chain.yaml@@ -55,7 +55,7 @@ edge_schema:required: truedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的供应链分析师,请从文本中提取供应链实体及其关系。diff --git a/hyperextract/templates/presets/general/clause_list.yaml b/hyperextract/templates/presets/general/clause_list.yamlindex e7389d2..50f868a 100644--- a/hyperextract/templates/presets/general/clause_list.yaml+++ b/hyperextract/templates/presets/general/clause_list.yaml@@ -28,7 +28,7 @@ item_schema:zh: "条文分类:总则、权利义务、程序、处罚、附则、其他"required: false-extraction_guide:+guide:target:zh: |你是一位专业的规章制度条文拆解专家,请将文本拆解为逐条的原子化条文。diff --git a/hyperextract/templates/presets/general/compliance_logic.yaml b/hyperextract/templates/presets/general/compliance_logic.yamlindex 86dda36..8d1fa5f 100644--- a/hyperextract/templates/presets/general/compliance_logic.yaml+++ b/hyperextract/templates/presets/general/compliance_logic.yaml@@ -53,7 +53,7 @@ edge_schema:zh: "规则来源条款"required: false-extraction_guide:+guide:target:zh: |你是一位专业的合规评估员,请从文本中提取合规要素和规则。diff --git a/hyperextract/templates/presets/general/concept_hierarchy.yaml b/hyperextract/templates/presets/general/concept_hierarchy.yamlindex 5c7cf8f..1b54879 100644--- a/hyperextract/templates/presets/general/concept_hierarchy.yaml+++ b/hyperextract/templates/presets/general/concept_hierarchy.yaml@@ -43,7 +43,7 @@ edge_schema:zh: "关系详细说明"required: false-extraction_guide:+guide:target:zh: |你是一位专业的概念结构分析专家,请从文本中提取概念及其层级关系。diff --git a/hyperextract/templates/presets/general/cross_reference_net.yaml b/hyperextract/templates/presets/general/cross_reference_net.yamlindex 56fe140..86e0862 100644--- a/hyperextract/templates/presets/general/cross_reference_net.yaml+++ b/hyperextract/templates/presets/general/cross_reference_net.yaml@@ -43,7 +43,7 @@ edge_schema:zh: "引用上下文描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的知识网络分析专家,请从文本中提取概念/条目及其相互引用关系。diff --git a/hyperextract/templates/presets/general/encyclopedia_item.yaml b/hyperextract/templates/presets/general/encyclopedia_item.yamlindex 26cc180..e047e2d 100644--- a/hyperextract/templates/presets/general/encyclopedia_item.yaml+++ b/hyperextract/templates/presets/general/encyclopedia_item.yaml@@ -48,7 +48,7 @@ schema:zh: "相关概念/条目"required: false-extraction_guide:+guide:target:zh: |你是一位专业的百科全书编辑,请从文本中提取单一主体的结构化属性信息,构建百科条目信息框。diff --git a/hyperextract/templates/presets/general/entity_registry.yaml b/hyperextract/templates/presets/general/entity_registry.yamlindex e4cd526..9072f58 100644--- a/hyperextract/templates/presets/general/entity_registry.yaml+++ b/hyperextract/templates/presets/general/entity_registry.yaml@@ -23,7 +23,7 @@ item_schema:zh: "简要描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的实体识别专家,请从文本中提取所有唯一实体,形成实体注册表。diff --git a/hyperextract/templates/presets/general/keyword_list.yaml b/hyperextract/templates/presets/general/keyword_list.yamlindex 80d5824..aaf0870 100644--- a/hyperextract/templates/presets/general/keyword_list.yaml+++ b/hyperextract/templates/presets/general/keyword_list.yaml@@ -23,7 +23,7 @@ item_schema:zh: "关键词简要描述或上下文说明"required: false-extraction_guide:+guide:target:zh: |你是一位专业的关键词提取专家,请从文本中提取所有关键词并附带分类和描述信息。diff --git a/hyperextract/templates/presets/general/knowledge_graph.yaml b/hyperextract/templates/presets/general/knowledge_graph.yamlindex 7bd2994..e4d6f3f 100644--- a/hyperextract/templates/presets/general/knowledge_graph.yaml+++ b/hyperextract/templates/presets/general/knowledge_graph.yaml@@ -43,7 +43,7 @@ edge_schema:zh: "详细描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的知识图谱提取专家,请从文本中提取实体及其关系。diff --git a/hyperextract/templates/presets/general/life_event_timeline.yaml b/hyperextract/templates/presets/general/life_event_timeline.yamlindex fb58468..61e4739 100644--- a/hyperextract/templates/presets/general/life_event_timeline.yaml+++ b/hyperextract/templates/presets/general/life_event_timeline.yaml@@ -48,7 +48,7 @@ edge_schema:zh: "事件详细描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的传记年表专家,请从文本中提取人物、地点、组织等实体以及生活事件。diff --git a/hyperextract/templates/presets/general/operational_procedure.yaml b/hyperextract/templates/presets/general/operational_procedure.yamlindex cc84fb3..1a2898e 100644--- a/hyperextract/templates/presets/general/operational_procedure.yaml+++ b/hyperextract/templates/presets/general/operational_procedure.yaml@@ -58,7 +58,7 @@ edge_schema:zh: "详细说明"required: false-extraction_guide:+guide:target:zh: |你是一位专业的流程分析专家,请从文本中提取执行程序的步骤和转换关系。diff --git a/hyperextract/templates/presets/general/penalty_mapping.yaml b/hyperextract/templates/presets/general/penalty_mapping.yamlindex 3e9aad1..0b48df7 100644--- a/hyperextract/templates/presets/general/penalty_mapping.yaml+++ b/hyperextract/templates/presets/general/penalty_mapping.yaml@@ -42,7 +42,7 @@ edge_schema:zh: "详细说明"required: false-extraction_guide:+guide:target:zh: |你是一位专业的处罚逻辑分析专家,请从文本中提取违规处罚的因果链。diff --git a/hyperextract/templates/presets/general/penalty_registry.yaml b/hyperextract/templates/presets/general/penalty_registry.yamlindex b8dc4f7..bdbe661 100644--- a/hyperextract/templates/presets/general/penalty_registry.yaml+++ b/hyperextract/templates/presets/general/penalty_registry.yaml@@ -32,7 +32,7 @@ item_schema:zh: "备注说明"required: false-extraction_guide:+guide:target:zh: |你是一位专业的合规分析专家,请从文本中提取所有违规行为及其对应的处罚措施,形成违规处罚对照表。diff --git a/hyperextract/templates/presets/general/personal_profile.yaml b/hyperextract/templates/presets/general/personal_profile.yamlindex 6c30683..7928ff6 100644--- a/hyperextract/templates/presets/general/personal_profile.yaml+++ b/hyperextract/templates/presets/general/personal_profile.yaml@@ -69,7 +69,7 @@ schema:zh: "个人简介"required: false-extraction_guide:+guide:target:zh: |你是一位专业的人物档案编辑,请从文本中提取该人物的静态属性信息,构建个人档案。diff --git a/hyperextract/templates/presets/general/regulation_profile.yaml b/hyperextract/templates/presets/general/regulation_profile.yamlindex 4940569..b095754 100644--- a/hyperextract/templates/presets/general/regulation_profile.yaml+++ b/hyperextract/templates/presets/general/regulation_profile.yaml@@ -64,7 +64,7 @@ schema:zh: "关联规章"required: false-extraction_guide:+guide:target:zh: |你是一位专业的规章制度分析专家,请从文本中提取该规章制度的元数据信息,构建规章元数据快照。diff --git a/hyperextract/templates/presets/general/social_network.yaml b/hyperextract/templates/presets/general/social_network.yamlindex 54f712d..fe6e6bd 100644--- a/hyperextract/templates/presets/general/social_network.yaml+++ b/hyperextract/templates/presets/general/social_network.yaml@@ -48,7 +48,7 @@ edge_schema:zh: "关系详细说明"required: false-extraction_guide:+guide:target:zh: |你是一位专业的社会关系分析专家,请从文本中提取人物、组织及其相互关系。diff --git a/hyperextract/templates/presets/industry/emergency_response_graph.yaml b/hyperextract/templates/presets/industry/emergency_response_graph.yamlindex 71c47ab..298a894 100644--- a/hyperextract/templates/presets/industry/emergency_response_graph.yaml+++ b/hyperextract/templates/presets/industry/emergency_response_graph.yaml@@ -61,7 +61,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位工业应急管理分析专家,请从文本中提取事故场景、响应动作和部门,构建应急响应流程。diff --git a/hyperextract/templates/presets/industry/equipment_topology_graph.yaml b/hyperextract/templates/presets/industry/equipment_topology_graph.yamlindex f3b3e25..972f233 100644--- a/hyperextract/templates/presets/industry/equipment_topology_graph.yaml+++ b/hyperextract/templates/presets/industry/equipment_topology_graph.yaml@@ -73,7 +73,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位工业设备管理专家,请从文本中提取设备实体及其相互连接关系。diff --git a/hyperextract/templates/presets/industry/failure_case_graph.yaml b/hyperextract/templates/presets/industry/failure_case_graph.yamlindex 07625b0..ed07afc 100644--- a/hyperextract/templates/presets/industry/failure_case_graph.yaml+++ b/hyperextract/templates/presets/industry/failure_case_graph.yaml@@ -61,7 +61,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位工业设备故障分析专家,请从文本中提取故障现象、原因、处理措施和经验教训。diff --git a/hyperextract/templates/presets/industry/failure_knowledge_hypergraph.yaml b/hyperextract/templates/presets/industry/failure_knowledge_hypergraph.yamlindex e56b5b4..6f82a0a 100644--- a/hyperextract/templates/presets/industry/failure_knowledge_hypergraph.yaml+++ b/hyperextract/templates/presets/industry/failure_knowledge_hypergraph.yaml@@ -49,7 +49,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位设备故障诊断专家,请从故障案例中提取故障知识实体和故障诊断推理作为超边。diff --git a/hyperextract/templates/presets/industry/incident_causality_map.yaml b/hyperextract/templates/presets/industry/incident_causality_map.yamlindex ca60b09..99c199a 100644--- a/hyperextract/templates/presets/industry/incident_causality_map.yaml+++ b/hyperextract/templates/presets/industry/incident_causality_map.yaml@@ -55,7 +55,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位工业安全事故调查专家,请从事故调查报告中提取实体和事故因果链条作为超边。diff --git a/hyperextract/templates/presets/industry/inspection_record_graph.yaml b/hyperextract/templates/presets/industry/inspection_record_graph.yamlindex 9b162d7..c33501e 100644--- a/hyperextract/templates/presets/industry/inspection_record_graph.yaml+++ b/hyperextract/templates/presets/industry/inspection_record_graph.yaml@@ -55,7 +55,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位工业设备巡检分析专家,请从文本中提取设备和巡检项,构建巡检层级结构。diff --git a/hyperextract/templates/presets/industry/maintenace_operation_map.yaml b/hyperextract/templates/presets/industry/maintenace_operation_map.yamlindex e3a87bb..5a3b523 100644--- a/hyperextract/templates/presets/industry/maintenace_operation_map.yaml+++ b/hyperextract/templates/presets/industry/maintenace_operation_map.yaml@@ -61,7 +61,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位设备维修管理专家,请从维修作业指导书中提取实体和维修作业中的复杂关联作为超边。diff --git a/hyperextract/templates/presets/industry/operating_mode_graph.yaml b/hyperextract/templates/presets/industry/operating_mode_graph.yamlindex 027abbb..cd7cd21 100644--- a/hyperextract/templates/presets/industry/operating_mode_graph.yaml+++ b/hyperextract/templates/presets/industry/operating_mode_graph.yaml@@ -67,7 +67,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位工业设备工况分析专家,请从文本中提取工况和条件实体,以及它们之间的关系。diff --git a/hyperextract/templates/presets/industry/operation_flow_graph.yaml b/hyperextract/templates/presets/industry/operation_flow_graph.yamlindex a2e9aea..6542167 100644--- a/hyperextract/templates/presets/industry/operation_flow_graph.yaml+++ b/hyperextract/templates/presets/industry/operation_flow_graph.yaml@@ -73,7 +73,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位工业操作流程分析专家,请从文本中提取操作步骤、设备状态和预期结果。diff --git a/hyperextract/templates/presets/industry/part_replacement_list.yaml b/hyperextract/templates/presets/industry/part_replacement_list.yamlindex c016fb0..5177522 100644--- a/hyperextract/templates/presets/industry/part_replacement_list.yaml+++ b/hyperextract/templates/presets/industry/part_replacement_list.yaml@@ -52,7 +52,7 @@ item_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位设备维护管理专家,请从备件更换记录中提取所有备件消耗条目。diff --git a/hyperextract/templates/presets/industry/safety_control_graph.yaml b/hyperextract/templates/presets/industry/safety_control_graph.yamlindex 0bfcffb..07ec21d 100644--- a/hyperextract/templates/presets/industry/safety_control_graph.yaml+++ b/hyperextract/templates/presets/industry/safety_control_graph.yaml@@ -67,7 +67,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位工业安全管理分析专家,请从文本中提取危险源、风险点和管控措施,构建安全管控关系。diff --git a/hyperextract/templates/presets/industry/safety_timeline.yaml b/hyperextract/templates/presets/industry/safety_timeline.yamlindex 01f592e..754e79c 100644--- a/hyperextract/templates/presets/industry/safety_timeline.yaml+++ b/hyperextract/templates/presets/industry/safety_timeline.yaml@@ -67,7 +67,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位工业安全事故调查专家,请从事故调查报告中提取时间线,还原事故发生前后的操作与响应序列。diff --git a/hyperextract/templates/presets/industry/spec_parameter_table.yaml b/hyperextract/templates/presets/industry/spec_parameter_table.yamlindex 2960b4f..f414c4a 100644--- a/hyperextract/templates/presets/industry/spec_parameter_table.yaml+++ b/hyperextract/templates/presets/industry/spec_parameter_table.yaml@@ -124,7 +124,7 @@ schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位工业设备技术专家,请从技术规格书中提取所有关键技术参数。diff --git a/hyperextract/templates/presets/industry/system_compatibility_graph.yaml b/hyperextract/templates/presets/industry/system_compatibility_graph.yamlindex ca93685..2956f35 100644--- a/hyperextract/templates/presets/industry/system_compatibility_graph.yaml+++ b/hyperextract/templates/presets/industry/system_compatibility_graph.yaml@@ -49,7 +49,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位工业设备选型专家,请从技术规格书中提取实体和设备与环境、介质的兼容性关系作为超边。diff --git a/hyperextract/templates/presets/industry/system_topology_graph.yaml b/hyperextract/templates/presets/industry/system_topology_graph.yamlindex 10db873..60e12b9 100644--- a/hyperextract/templates/presets/industry/system_topology_graph.yaml+++ b/hyperextract/templates/presets/industry/system_topology_graph.yaml@@ -55,7 +55,7 @@ edge_schema:required: truedefault: ""-extraction_guide:+guide:target:zh: |你是一位工业系统架构分析专家,请从文本中提取实体和它们之间的层级关系。diff --git a/hyperextract/templates/presets/legal/adjudication_logic.yaml b/hyperextract/templates/presets/legal/adjudication_logic.yamlindex 84cebc0..200f48b 100644--- a/hyperextract/templates/presets/legal/adjudication_logic.yaml+++ b/hyperextract/templates/presets/legal/adjudication_logic.yaml@@ -61,7 +61,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的法律工作者,请从裁判文书中提取裁判要素和裁判逻辑。diff --git a/hyperextract/templates/presets/legal/beneficial_ownership_graph.yaml b/hyperextract/templates/presets/legal/beneficial_ownership_graph.yamlindex cc744e0..78ad3a0 100644--- a/hyperextract/templates/presets/legal/beneficial_ownership_graph.yaml+++ b/hyperextract/templates/presets/legal/beneficial_ownership_graph.yaml@@ -61,7 +61,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的反洗钱合规专员,请从文本中提取股权结构和受益所有权信息。diff --git a/hyperextract/templates/presets/legal/case_fact_timeline.yaml b/hyperextract/templates/presets/legal/case_fact_timeline.yamlindex 7a900dd..7904ae1 100644--- a/hyperextract/templates/presets/legal/case_fact_timeline.yaml+++ b/hyperextract/templates/presets/legal/case_fact_timeline.yaml@@ -61,7 +61,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的法律工作者,请从文本中提取案件相关的法律实体以及它们之间的法律行为。diff --git a/hyperextract/templates/presets/legal/case_law_citation_net.yaml b/hyperextract/templates/presets/legal/case_law_citation_net.yamlindex 01a509a..7d5abc7 100644--- a/hyperextract/templates/presets/legal/case_law_citation_net.yaml+++ b/hyperextract/templates/presets/legal/case_law_citation_net.yaml@@ -61,7 +61,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的法学专家,请从文本中提取所有判例以及它们之间的引用或关联关系。diff --git a/hyperextract/templates/presets/legal/compliance_requirement_list.yaml b/hyperextract/templates/presets/legal/compliance_requirement_list.yamlindex 514feda..d56cc99 100644--- a/hyperextract/templates/presets/legal/compliance_requirement_list.yaml+++ b/hyperextract/templates/presets/legal/compliance_requirement_list.yaml@@ -52,7 +52,7 @@ item_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的合规顾问,请从法规或政策文件中提取所有合规义务。diff --git a/hyperextract/templates/presets/legal/contract_obligation_hypergraph.yaml b/hyperextract/templates/presets/legal/contract_obligation_hypergraph.yamlindex 6e43be3..bb82a24 100644--- a/hyperextract/templates/presets/legal/contract_obligation_hypergraph.yaml+++ b/hyperextract/templates/presets/legal/contract_obligation_hypergraph.yaml@@ -67,7 +67,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的合同法律师,请从文本中提取合同要素和合同义务。diff --git a/hyperextract/templates/presets/legal/defined_term_registry.yaml b/hyperextract/templates/presets/legal/defined_term_registry.yamlindex 6582027..edc6f74 100644--- a/hyperextract/templates/presets/legal/defined_term_registry.yaml+++ b/hyperextract/templates/presets/legal/defined_term_registry.yaml@@ -28,7 +28,7 @@ item_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的合同法律师,请从文本中提取所有定义的术语,形成术语定义表。diff --git a/hyperextract/templates/presets/legal/legal_concept_ontology.yaml b/hyperextract/templates/presets/legal/legal_concept_ontology.yamlindex 5c90e4f..81d9f5b 100644--- a/hyperextract/templates/presets/legal/legal_concept_ontology.yaml+++ b/hyperextract/templates/presets/legal/legal_concept_ontology.yaml@@ -55,7 +55,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的法学专家,请从文本中提取所有法律概念以及它们之间的关系。diff --git a/hyperextract/templates/presets/legal/liability_clause_list.yaml b/hyperextract/templates/presets/legal/liability_clause_list.yamlindex 04fca90..43dc106 100644--- a/hyperextract/templates/presets/legal/liability_clause_list.yaml+++ b/hyperextract/templates/presets/legal/liability_clause_list.yaml@@ -40,7 +40,7 @@ item_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的合同法律师,请从文本中提取所有关于责任、赔偿、保证的条款。diff --git a/hyperextract/templates/presets/legal/litigation_participant_map.yaml b/hyperextract/templates/presets/legal/litigation_participant_map.yamlindex f93b240..1562c4a 100644--- a/hyperextract/templates/presets/legal/litigation_participant_map.yaml+++ b/hyperextract/templates/presets/legal/litigation_participant_map.yaml@@ -55,7 +55,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的法律文书分析师,请从文本中提取诉讼参与人及其之间的关系。diff --git a/hyperextract/templates/presets/medicine/adverse_reaction_stats.yaml b/hyperextract/templates/presets/medicine/adverse_reaction_stats.yamlindex a2b6655..1fef34b 100644--- a/hyperextract/templates/presets/medicine/adverse_reaction_stats.yaml+++ b/hyperextract/templates/presets/medicine/adverse_reaction_stats.yaml@@ -27,7 +27,7 @@ item_schema:zh: "详细描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的临床药师,请从文本中提取各系统的不良反应表现及其发生率描述,构建不良反应统计。diff --git a/hyperextract/templates/presets/medicine/anatomy_hierarchy.yaml b/hyperextract/templates/presets/medicine/anatomy_hierarchy.yamlindex 37725d8..c105ce6 100644--- a/hyperextract/templates/presets/medicine/anatomy_hierarchy.yaml+++ b/hyperextract/templates/presets/medicine/anatomy_hierarchy.yaml@@ -43,7 +43,7 @@ edge_schema:zh: "详细描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的解剖学家,请从文本中提取解剖结构及其关系,构建解剖层级树。diff --git a/hyperextract/templates/presets/medicine/clinical_pathway.yaml b/hyperextract/templates/presets/medicine/clinical_pathway.yamlindex 9e8aba4..45f4e3e 100644--- a/hyperextract/templates/presets/medicine/clinical_pathway.yaml+++ b/hyperextract/templates/presets/medicine/clinical_pathway.yaml@@ -43,7 +43,7 @@ edge_schema:zh: "详细描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的临床医生,请从文本中提取"如果症状A则检查B否则治疗C"的决策树结构,构建临床路径图。diff --git a/hyperextract/templates/presets/medicine/complex_interaction_net.yaml b/hyperextract/templates/presets/medicine/complex_interaction_net.yamlindex db0c387..88bd7b3 100644--- a/hyperextract/templates/presets/medicine/complex_interaction_net.yaml+++ b/hyperextract/templates/presets/medicine/complex_interaction_net.yaml@@ -42,7 +42,7 @@ edge_schema:description:zh: "详细描述,如具体的相互作用机制"-extraction_guide:+guide:target:zh: |你是一位专业的临床药师,请从文本中提取药物相互作用信息,构建条件性相互作用网。diff --git a/hyperextract/templates/presets/medicine/contraindication_list.yaml b/hyperextract/templates/presets/medicine/contraindication_list.yamlindex 5186319..6ba0c83 100644--- a/hyperextract/templates/presets/medicine/contraindication_list.yaml+++ b/hyperextract/templates/presets/medicine/contraindication_list.yaml@@ -23,7 +23,7 @@ item_schema:zh: "详细描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的临床药师,请从文本中提取绝对禁忌(如孕妇、严重肾衰竭等)的明确列表,构建禁忌症清单。diff --git a/hyperextract/templates/presets/medicine/discharge_instruction.yaml b/hyperextract/templates/presets/medicine/discharge_instruction.yamlindex 933ef74..dcbe79d 100644--- a/hyperextract/templates/presets/medicine/discharge_instruction.yaml+++ b/hyperextract/templates/presets/medicine/discharge_instruction.yaml@@ -40,7 +40,7 @@ schema:zh: "其他注意事项列表"required: false-extraction_guide:+guide:target:zh: |你是一位专业的医生,请从文本中提取出院带药、复诊计划及康复建议的结构化信息,构建出院医嘱摘要。diff --git a/hyperextract/templates/presets/medicine/hospital_course_timeline.yaml b/hyperextract/templates/presets/medicine/hospital_course_timeline.yamlindex 9b331c0..711869b 100644--- a/hyperextract/templates/presets/medicine/hospital_course_timeline.yaml+++ b/hyperextract/templates/presets/medicine/hospital_course_timeline.yaml@@ -47,7 +47,7 @@ edge_schema:zh: "详细描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的医院管理人员,请从文本中严格按时间顺序提取入院、检查、治疗、转归等节点,构建住院病程时间轴。diff --git a/hyperextract/templates/presets/medicine/level_of_evidence.yaml b/hyperextract/templates/presets/medicine/level_of_evidence.yamlindex e41b060..fd014e4 100644--- a/hyperextract/templates/presets/medicine/level_of_evidence.yaml+++ b/hyperextract/templates/presets/medicine/level_of_evidence.yaml@@ -35,7 +35,7 @@ item_schema:zh: "详细描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的循证医学专家,请从文本中提取指南中的具体推荐意见及其对应的证据等级,构建证据评级表。diff --git a/hyperextract/templates/presets/medicine/medical_concept_net.yaml b/hyperextract/templates/presets/medicine/medical_concept_net.yamlindex dadb649..d58ed57 100644--- a/hyperextract/templates/presets/medicine/medical_concept_net.yaml+++ b/hyperextract/templates/presets/medicine/medical_concept_net.yaml@@ -43,7 +43,7 @@ edge_schema:zh: "详细描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的医学术语专家,请从文本中提取医学术语及其关联属性,构建医学概念网络。diff --git a/hyperextract/templates/presets/medicine/microscopic_feature_set.yaml b/hyperextract/templates/presets/medicine/microscopic_feature_set.yamlindex e160e77..d0147e4 100644--- a/hyperextract/templates/presets/medicine/microscopic_feature_set.yaml+++ b/hyperextract/templates/presets/medicine/microscopic_feature_set.yaml@@ -27,7 +27,7 @@ item_schema:zh: "特征描述"required: false-extraction_guide:+guide:target:zh: |你是一位专业的病理学家,请从文本中提取免疫组化指标(如 HER2+, Ki67)及基因突变状态,构建微观特征集。diff --git a/hyperextract/templates/presets/medicine/pathology_hypergraph.yaml b/hyperextract/templates/presets/medicine/pathology_hypergraph.yamlindex 154d101..44d1940 100644--- a/hyperextract/templates/presets/medicine/pathology_hypergraph.yaml+++ b/hyperextract/templates/presets/medicine/pathology_hypergraph.yaml@@ -46,7 +46,7 @@ edge_schema:description:zh: "该机制导致的结果或效应"-extraction_guide:+guide:target:zh: |你是一位专业的病理学家,请从文本中提取与疾病病理机制相关的实体和它们之间的复杂关联关系,构建多因素病理机制图。diff --git a/hyperextract/templates/presets/medicine/pharmacology_graph.yaml b/hyperextract/templates/presets/medicine/pharmacology_graph.yamlindex 0d3f50f..fa6c406 100644--- a/hyperextract/templates/presets/medicine/pharmacology_graph.yaml+++ b/hyperextract/templates/presets/medicine/pharmacology_graph.yaml@@ -42,7 +42,7 @@ edge_schema:description:zh: "详细描述,如具体的作用机制"-extraction_guide:+guide:target:zh: |你是一位专业的药理学家,请从文本中提取药物、受体、靶点及生理反应之间的相互作用路径,构建药理机制图。diff --git a/hyperextract/templates/presets/medicine/surgical_event_graph.yaml b/hyperextract/templates/presets/medicine/surgical_event_graph.yamlindex 2c56f68..8a2a443 100644--- a/hyperextract/templates/presets/medicine/surgical_event_graph.yaml+++ b/hyperextract/templates/presets/medicine/surgical_event_graph.yaml@@ -47,7 +47,7 @@ edge_schema:description:zh: "详细描述,如手术过程"-extraction_guide:+guide:target:zh: |你是一位专业的外科医生,请从文本中提取手术事件及其相关实体,构建手术事件超图。diff --git a/hyperextract/templates/presets/medicine/treatment_regimen_map.yaml b/hyperextract/templates/presets/medicine/treatment_regimen_map.yamlindex 46d1226..371c525 100644--- a/hyperextract/templates/presets/medicine/treatment_regimen_map.yaml+++ b/hyperextract/templates/presets/medicine/treatment_regimen_map.yaml@@ -42,7 +42,7 @@ edge_schema:description:zh: "详细描述,如具体的治疗方案内容"-extraction_guide:+guide:target:zh: |你是一位专业的临床医生,请从文本中提取由"药物组合+理疗+生活干预"构成的多因素治疗方案,构建综合治疗方案图。diff --git a/hyperextract/templates/presets/medicine/tumor_staging_item.yaml b/hyperextract/templates/presets/medicine/tumor_staging_item.yamlindex 2a87c2b..0ff347f 100644--- a/hyperextract/templates/presets/medicine/tumor_staging_item.yaml+++ b/hyperextract/templates/presets/medicine/tumor_staging_item.yaml@@ -38,7 +38,7 @@ schema:description:zh: "M分期详细描述,如远处转移部位"-extraction_guide:+guide:target:zh: |你是一位专业的病理学家,请从文本中提取肿瘤大小(T)、淋巴结(N)、转移(M)及分期结果,构建TNM分期表。diff --git a/hyperextract/templates/presets/tcm/acupoint_location_map.yaml b/hyperextract/templates/presets/tcm/acupoint_location_map.yamlindex acbea2f..604b14a 100644--- a/hyperextract/templates/presets/tcm/acupoint_location_map.yaml+++ b/hyperextract/templates/presets/tcm/acupoint_location_map.yaml@@ -61,7 +61,7 @@ edge_schema:required: truedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的针灸学专家,请从文本中提取穴位的相对位置关系。diff --git a/hyperextract/templates/presets/tcm/compatibility_net.yaml b/hyperextract/templates/presets/tcm/compatibility_net.yamlindex 326578a..a45734e 100644--- a/hyperextract/templates/presets/tcm/compatibility_net.yaml+++ b/hyperextract/templates/presets/tcm/compatibility_net.yaml@@ -49,7 +49,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的中药配伍专家,请从文本中提取药物间的配伍关系。diff --git a/hyperextract/templates/presets/tcm/formula_composition.yaml b/hyperextract/templates/presets/tcm/formula_composition.yamlindex f5dc307..b9232c8 100644--- a/hyperextract/templates/presets/tcm/formula_composition.yaml+++ b/hyperextract/templates/presets/tcm/formula_composition.yaml@@ -91,7 +91,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的方剂学专家,请从文本中提取方剂的君臣佐使结构。diff --git a/hyperextract/templates/presets/tcm/function_indication_map.yaml b/hyperextract/templates/presets/tcm/function_indication_map.yamlindex 0ae54ec..403af2b 100644--- a/hyperextract/templates/presets/tcm/function_indication_map.yaml+++ b/hyperextract/templates/presets/tcm/function_indication_map.yaml@@ -55,7 +55,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的方剂学专家,请从文本中提取方剂、功能和主治证候之间的关联关系。diff --git a/hyperextract/templates/presets/tcm/herb_property_model.yaml b/hyperextract/templates/presets/tcm/herb_property_model.yamlindex 4b0b902..b90ee65 100644--- a/hyperextract/templates/presets/tcm/herb_property_model.yaml+++ b/hyperextract/templates/presets/tcm/herb_property_model.yaml@@ -76,7 +76,7 @@ schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的中药学家,请从文本中提取单味药的性味归经、毒性及推荐剂量等信息。diff --git a/hyperextract/templates/presets/tcm/meridian_flow_graph.yaml b/hyperextract/templates/presets/tcm/meridian_flow_graph.yamlindex 5b51d8d..a13101b 100644--- a/hyperextract/templates/presets/tcm/meridian_flow_graph.yaml+++ b/hyperextract/templates/presets/tcm/meridian_flow_graph.yaml@@ -67,7 +67,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的经络学专家,请从文本中提取十二经脉的循行路线及经气流注次序。diff --git a/hyperextract/templates/presets/tcm/prescription_modification.yaml b/hyperextract/templates/presets/tcm/prescription_modification.yamlindex 00d678d..71ea76d 100644--- a/hyperextract/templates/presets/tcm/prescription_modification.yaml+++ b/hyperextract/templates/presets/tcm/prescription_modification.yaml@@ -61,7 +61,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的中医方剂专家,请从文本中提取处方加减的实体和超边结构。diff --git a/hyperextract/templates/presets/tcm/processing_method.yaml b/hyperextract/templates/presets/tcm/processing_method.yamlindex 7c40d47..5764c11 100644--- a/hyperextract/templates/presets/tcm/processing_method.yaml+++ b/hyperextract/templates/presets/tcm/processing_method.yaml@@ -40,7 +40,7 @@ item_schema:required: truedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的中药炮制专家,请从文本中提取药物的不同炮制方法及其对药效的影响。diff --git a/hyperextract/templates/presets/tcm/pulse_tongue_record.yaml b/hyperextract/templates/presets/tcm/pulse_tongue_record.yamlindex 0b0d033..0357b92 100644--- a/hyperextract/templates/presets/tcm/pulse_tongue_record.yaml+++ b/hyperextract/templates/presets/tcm/pulse_tongue_record.yaml@@ -46,7 +46,7 @@ item_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的中医诊断专家,请从文本中提取舌象和脉象的特征信息。diff --git a/hyperextract/templates/presets/tcm/syndrome_reasoning_graph.yaml b/hyperextract/templates/presets/tcm/syndrome_reasoning_graph.yamlindex 3133bad..50e8572 100644--- a/hyperextract/templates/presets/tcm/syndrome_reasoning_graph.yaml+++ b/hyperextract/templates/presets/tcm/syndrome_reasoning_graph.yaml@@ -55,7 +55,7 @@ edge_schema:required: falsedefault: ""-extraction_guide:+guide:target:zh: |你是一位专业的中医辨证论治专家,请从文本中提取中医实体和辨证论治推理逻辑作为超边。diff --git "a/hyperextract/templates/\347\237\245\350\257\206\346\250\241\346\235\277\350\256\276\350\256\241\346\214\207\345\215\227.md" "b/hyperextract/templates/\347\237\245\350\257\206\346\250\241\346\235\277\350\256\276\350\256\241\346\214\207\345\215\227.md"index f6404ec..dc83373 100644--- "a/hyperextract/templates/\347\237\245\350\257\206\346\250\241\346\235\277\350\256\276\350\256\241\346\214\207\345\215\227.md"+++ "b/hyperextract/templates/\347\237\245\350\257\206\346\250\241\346\235\277\350\256\276\350\256\241\346\214\207\345\215\227.md"@@ -45,7 +45,7 @@ YAML(YAML Ain't Markup Language)是一种人类可读的数据序列化格┌─────────────────────────────────────────────────────────────┐│ YAML 配置文件 ││ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────────────┐ │-│ │ name │ │ autotype│ │ schema │ │ extraction_guide│ │+│ │ name │ │ autotype│ │ schema │ │ guide│ ││ │ tag │ │ language│ │ ... │ │ identifiers │ ││ │ ... │ │ │ │ │ │ display │ ││ └─────────┘ └─────────┘ └─────────┘ └─────────────────┘ │@@ -128,7 +128,7 @@ schema:type: stringdescription: "字段描述"-extraction_guide:+guide:target: "你是一位专家,请从文本中提取信息。"rules: |@@ -171,7 +171,7 @@ edge_schema:type: stringdescription: "关系类型"-extraction_guide:+guide:target: "你是一位领域专家,请从文本中提取知识图谱关系。"rules_for_nodes: |@@ -218,14 +218,14 @@ display:| 字段 | 说明 ||------|------|| `schema` / `item_schema` / `node_schema` / `edge_schema` | 数据结构定义 |-| `extraction_guide` | 提取指南 |+| `guide` | 提取指南 || `identifiers` | 标识配置 || `parameters` | 运行时参数 || `display` | 展示配置 |### 3.3 Rules 字段格式说明-`extraction_guide` 中的 `rules`、`rules_for_nodes`、`rules_for_edges`、`rules_for_time`、`rules_for_location` 等字段使用 List 格式:+`guide` 中的 `rules`、`rules_for_nodes`、`rules_for_edges`、`rules_for_time`、`rules_for_location` 等字段使用 List 格式:```yamlrules:@@ -328,9 +328,9 @@ schema:default: "N/A"```-**extraction_guide 编写**:+**guide 编写**:```yaml-extraction_guide:+guide:target: "你是一位财务分析师,请从财报中提取关键信息。"rules:@@ -363,7 +363,7 @@ schema:type: stringdescription: "营收金额"-extraction_guide:+guide:target: "你是一位财务分析师,请从财报中提取关键信息。"rules:@@ -411,7 +411,7 @@ item_schema:type: stringdescription: "关键词"-extraction_guide:+guide:target: "你是一位关键词提取专家"rules:@@ -451,7 +451,7 @@ item_schema:type: stringdescription: "实体类型"-extraction_guide:+guide:target: "你是一位实体识别专家"rules:@@ -505,9 +505,9 @@ identifiers:target: target```-**extraction_guide 编写**:+**guide 编写**:```yaml-extraction_guide:+guide:target: "你是一位知识图谱专家,请从文本中提取实体关系。"rules_for_nodes:@@ -577,9 +577,9 @@ identifiers:time_field: "fiscal_period"```-**特有 extraction_guide 编写**:+**特有 guide 编写**:```yaml-extraction_guide:+guide:rules_for_time:- "当前观察日期:{observation_time}"- "'去年' → {observation_time} 的前一年"@@ -602,9 +602,9 @@ identifiers:location_field: "location"```-**特有 extraction_guide 编写**:+**特有 guide 编写**:```yaml-extraction_guide:+guide:rules_for_location:- "当前观察位置:{observation_location}"- "'这里' → {observation_location}"diff --git a/hyperextract/utils/__init__.py b/hyperextract/utils/__init__.pyindex 5407d0f..cd61787 100644--- a/hyperextract/utils/__init__.py+++ b/hyperextract/utils/__init__.py@@ -1,8 +1,12 @@"""Hyperextract utilities module."""from .logging import logger, setup_logger+from .client import get_client+from .template_engine import Template__all__ = ["logger","setup_logger",+ "get_client",+ "Template",]diff --git a/hyperextract/utils/client.py b/hyperextract/utils/client.pynew file mode 100644index 0000000..0599a2d--- /dev/null+++ b/hyperextract/utils/client.py@@ -0,0 +1,129 @@+"""Client Factory - Create LLM and Embedder clients from config file."""++import os+from pathlib import Path+from typing import Optional, Tuple, Union++from langchain_core.embeddings import Embeddings+from langchain_core.language_models.chat_models import BaseChatModel++DEFAULT_CONFIG_DIR = Path.home() / ".he"+DEFAULT_CONFIG_FILE = DEFAULT_CONFIG_DIR / "config.toml"+++def get_client(config_path: Optional[Union[str, Path]] = None) -> Tuple:+ """Get LLM client and Embedder from config file.++ Args:+ config_path: Config file path, default ~/.he/config.toml++ Returns:+ (llm_client, embedder) tuple++ Examples:+ >>> from hyperextract.utils import get_client+ >>> llm, emb = get_client()+ >>> # Or with custom config path+ >>> llm, emb = get_client("/path/to/config.toml")+ """+ from hyperextract.cli.config import ConfigManager++ path = Path(config_path) if config_path else DEFAULT_CONFIG_FILE+ manager = ConfigManager(path)++ llm_config = manager.get_llm_config()+ emb_config = manager.get_embedder_config()++ llm_client = _create_llm_client(llm_config)+ embedder = _create_embedder(emb_config)++ return llm_client, embedder+++def _create_llm_client(config) -> "BaseChatModel":+ """Create LLM client from config."""+ if config.provider == "openai":+ from langchain_openai import ChatOpenAI++ return ChatOpenAI(+ model=config.model,+ api_key=config.api_key or os.environ.get("OPENAI_API_KEY", ""),+ base_url=config.base_url or None,+ temperature=0,+ )+ elif config.provider == "anthropic":+ try:+ from langchain_anthropic import ChatAnthropic+ except ImportError:+ raise ImportError(+ "Anthropic support requires the 'langchain-anthropic' package.\n"+ "Install it with one of:\n"+ " pip install hyperextract[anthropic]\n"+ " pip install langchain-anthropic"+ )++ return ChatAnthropic(+ model=config.model,+ api_key=config.api_key or os.environ.get("ANTHROPIC_API_KEY", ""),+ )+ elif config.provider == "google":+ try:+ from langchain_google_genai import ChatGoogleGenerativeAI+ except ImportError:+ raise ImportError(+ "Google support requires the 'langchain-google-genai' package.\n"+ "Install it with one of:\n"+ " pip install hyperextract[google]\n"+ " pip install langchain-google-genai"+ )++ return ChatGoogleGenerativeAI(+ model=config.model,+ google_api_key=config.api_key or os.environ.get("GOOGLE_API_KEY", ""),+ )+ else:+ raise ValueError(f"Unsupported LLM provider: {config.provider}")+++def _create_embedder(config) -> "Embeddings":+ """Create Embedder from config."""+ if config.provider == "openai":+ from langchain_openai import OpenAIEmbeddings++ return OpenAIEmbeddings(+ model=config.model,+ api_key=config.api_key or os.environ.get("OPENAI_API_KEY", ""),+ base_url=config.base_url or None,+ )+ elif config.provider == "anthropic":+ try:+ from langchain_anthropic import AnthropicEmbeddings+ except ImportError:+ raise ImportError(+ "Anthropic support requires the 'langchain-anthropic' package.\n"+ "Install it with one of:\n"+ " pip install hyperextract[anthropic]\n"+ " pip install langchain-anthropic"+ )++ return AnthropicEmbeddings(+ model=config.model,+ api_key=config.api_key or os.environ.get("ANTHROPIC_API_KEY", ""),+ )+ elif config.provider == "google":+ try:+ from langchain_google_genai import GoogleGenerativeAIEmbeddings+ except ImportError:+ raise ImportError(+ "Google support requires the 'langchain-google-genai' package.\n"+ "Install it with one of:\n"+ " pip install hyperextract[google]\n"+ " pip install langchain-google-genai"+ )++ return GoogleGenerativeAIEmbeddings(+ model=config.model,+ google_api_key=config.api_key or os.environ.get("GOOGLE_API_KEY", ""),+ )+ else:+ raise ValueError(f"Unsupported Embedder provider: {config.provider}")diff --git a/hyperextract/utils/template_engine/__init__.py b/hyperextract/utils/template_engine/__init__.pyindex 09c0942..2c86c38 100644--- a/hyperextract/utils/template_engine/__init__.py+++ b/hyperextract/utils/template_engine/__init__.py@@ -2,54 +2,36 @@This module provides functionality to dynamically generate HyperExtract templates from YAML configuration files.-Usage Examples:- >>> from hyperextract.utils.template_engine import Gallery, TemplateFactory- >>>- >>> # Get template (auto-loaded presets and customs)- >>> config = Gallery.get("KnowledgeGraph")- >>> template = TemplateFactory.create(config, llm_client, embedder)- >>>- >>> # List all templates- >>> print(Gallery.list_all())- >>>- >>> # Add custom template directory (auto-loaded)- >>> Gallery.add_path("/path/to/my/templates")+Usage:+ # Recommended: use Template class+ from hyperextract.utils import Template++ Template.list()+ Template.search("知识图谱")+ template = Template.create("knowledge_graph")++ # Advanced: use Gallery and Factory directly+ from hyperextract.utils.template_engine import Gallery, TemplateFactory"""-from .config_loader import (+from .template import Template+from .gallery import Gallery+from .factory import TemplateFactory+from .builder import (TemplateConfig,ConfigLoader,- FieldDescription,- SchemaField,- ExtractionGuide,- Identifiers,- Parameters,- Display,+ SchemaBuilder,+ PromptBuilder,+ IdentifierResolver,)-from .schema_builder import SchemaBuilder--from .identifier_resolver import IdentifierResolver--from .prompt_builder import PromptBuilder--from .template_factory import TemplateFactory--from .template_gallery import Gallery--__all__ = [+ "Template",+ "Gallery",+ "TemplateFactory","TemplateConfig","ConfigLoader",- "FieldDescription",- "SchemaField",- "ExtractionGuide",- "Identifiers",- "Parameters",- "Display","SchemaBuilder",- "IdentifierResolver","PromptBuilder",- "TemplateFactory",- "Gallery",+ "IdentifierResolver",]diff --git a/hyperextract/utils/template_engine/builder/__init__.py b/hyperextract/utils/template_engine/builder/__init__.pynew file mode 100644index 0000000..97ca9de--- /dev/null+++ b/hyperextract/utils/template_engine/builder/__init__.py@@ -0,0 +1,36 @@+"""Builder module - Configuration models, loaders and builders."""++from .loader import TemplateConfig, ConfigLoader, Parameters, Display+from .schema import (+ FieldDescription,+ SchemaField,+ BaseSchema,+ ModelSchema,+ ItemSchema,+ NodeSchema,+ EdgeSchema,+ SchemaBuilder,+)+from .extraction import GuideTarget, Guide, PromptBuilder+from .identifiers import Identifiers, IdentifierResolver+++__all__ = [+ "TemplateConfig",+ "ConfigLoader",+ "Parameters",+ "Display",+ "FieldDescription",+ "SchemaField",+ "BaseSchema",+ "ModelSchema",+ "ItemSchema",+ "NodeSchema",+ "EdgeSchema",+ "SchemaBuilder",+ "GuideTarget",+ "Guide",+ "PromptBuilder",+ "Identifiers",+ "IdentifierResolver",+]diff --git a/hyperextract/utils/template_engine/prompt_builder.py b/hyperextract/utils/template_engine/builder/extraction.pysimilarity index 58%rename from hyperextract/utils/template_engine/prompt_builder.pyrename to hyperextract/utils/template_engine/builder/extraction.pyindex fbcfb86..d5c0ca0 100644--- a/hyperextract/utils/template_engine/prompt_builder.py+++ b/hyperextract/utils/template_engine/builder/extraction.py@@ -1,10 +1,55 @@-"""Prompt Builder - Builds extraction prompts for various AutoType.--Supports extraction_guide target field, automatically adds titles to rules.-"""+"""Extraction models and prompt builder."""from typing import Any, Callable, Dict, List, Optional, Tuple, Union-from .config_loader import ExtractionGuide+from pydantic import BaseModel+++class GuideTarget(BaseModel):+ """Extraction target with role definition and content description."""++ zh: Optional[str] = None+ en: Optional[str] = None++ @classmethod+ def from_value(cls, value: Union[str, Dict[str, str], None]) -> Optional["GuideTarget"]:+ """Create instance from string or dict."""+ if value is None:+ return None+ if isinstance(value, str):+ return cls(zh=value)+ if isinstance(value, dict):+ return cls(**value)+ return None++ def get(self, language: str = "zh") -> str:+ """Get content for specified language."""+ return getattr(self, language) or self.zh or ""+++class Guide(BaseModel):+ """Guide configuration."""++ target: Optional[Union[str, List[str], Dict[str, Union[str, List[str]]]]] = None+ rules: Optional[Union[List[str], Dict[str, List[str]]]] = None+ rules_for_nodes: Optional[Union[List[str], Dict[str, List[str]]]] = None+ rules_for_edges: Optional[Union[List[str], Dict[str, List[str]]]] = None+ rules_for_time: Optional[Union[List[str], Dict[str, List[str]]]] = None+ rules_for_location: Optional[Union[List[str], Dict[str, List[str]]]] = None++ def get_field(self, field_name: str, language: str = "zh") -> Optional[str]:+ """Get specified field content for specified language."""+ value = getattr(self, field_name, None)+ if value is None:+ return None+ if isinstance(value, list):+ return "\n".join(f"{i+1}. {item}" for i, item in enumerate(value))+ if isinstance(value, dict):+ dict_value = value.get(language) or value.get("zh")+ if dict_value is None:+ return None+ if isinstance(dict_value, list):+ return "\n".join(f"{i+1}. {item}" for i, item in enumerate(dict_value))+ return NoneLABEL_MAPPING = {@@ -32,7 +77,7 @@ LABEL_MAPPING = {class PromptBuilder:- """Prompt Builder."""+ """Prompt Builder - Builds extraction prompts for various AutoType."""def __init__(self, language: str = "zh"):"""Initialize Prompt Builder."""@@ -59,57 +104,57 @@ class PromptBuilder:title = self.labels.get(title_key, title_key)return f"### {title}\n{text}"- def build_target(self, extraction_guide: ExtractionGuide) -> Optional[str]:+ def build_target(self, guide: Guide) -> Optional[str]:"""Build target field (role definition + extraction content description)."""- target = extraction_guide.target+ target = guide.targetif target is None:return Nonereturn self._get_text(target, self.language)- def build_rules(self, extraction_guide: ExtractionGuide) -> Optional[str]:+ def build_rules(self, guide: Guide) -> Optional[str]:"""Build rules field (with title)."""- rules = self._get_text(extraction_guide.rules, self.language)+ rules = self._get_text(guide.rules, self.language)if rules:return self._add_title(rules, "extraction_rules")return None- def build_rules_for_nodes(self, extraction_guide: ExtractionGuide) -> Optional[str]:+ def build_rules_for_nodes(self, guide: Guide) -> Optional[str]:"""Build rules_for_nodes field (with title)."""- rules = self._get_text(extraction_guide.rules_for_nodes, self.language)+ rules = self._get_text(guide.rules_for_nodes, self.language)if rules:return self._add_title(rules, "node_extraction_rules")return None- def build_rules_for_edges(self, extraction_guide: ExtractionGuide) -> Optional[str]:+ def build_rules_for_edges(self, guide: Guide) -> Optional[str]:"""Build rules_for_edges field (with title)."""- rules = self._get_text(extraction_guide.rules_for_edges, self.language)+ rules = self._get_text(guide.rules_for_edges, self.language)if rules:return self._add_title(rules, "edge_extraction_rules")return None- def build_rules_for_time(self, extraction_guide: ExtractionGuide) -> Optional[str]:+ def build_rules_for_time(self, guide: Guide) -> Optional[str]:"""Build rules_for_time field (with title)."""- rules = self._get_text(extraction_guide.rules_for_time, self.language)+ rules = self._get_text(guide.rules_for_time, self.language)if rules:return self._add_title(rules, "time_rules")return None- def build_rules_for_location(self, extraction_guide: ExtractionGuide) -> Optional[str]:+ def build_rules_for_location(self, guide: Guide) -> Optional[str]:"""Build rules_for_location field (with title)."""- rules = self._get_text(extraction_guide.rules_for_location, self.language)+ rules = self._get_text(guide.rules_for_location, self.language)if rules:return self._add_title(rules, "location_rules")return None- def build_model_prompt(self, extraction_guide: ExtractionGuide) -> str:+ def build_model_prompt(self, guide: Guide) -> str:"""Build Model/List/Set type Prompt."""parts = []- target = self.build_target(extraction_guide)+ target = self.build_target(guide)if target:parts.append(target)- rules = self.build_rules(extraction_guide)+ rules = self.build_rules(guide)if rules:parts.append(rules)@@ -118,19 +163,19 @@ class PromptBuilder:return "\n\n".join(parts)- def build_graph_main_prompt(self, extraction_guide: ExtractionGuide) -> str:+ def build_graph_main_prompt(self, guide: Guide) -> str:"""Build Graph type main Prompt (single-stage mode)."""parts = []- target = self.build_target(extraction_guide)+ target = self.build_target(guide)if target:parts.append(target)- rules_for_nodes = self.build_rules_for_nodes(extraction_guide)+ rules_for_nodes = self.build_rules_for_nodes(guide)if rules_for_nodes:parts.append(rules_for_nodes)- rules_for_edges = self.build_rules_for_edges(extraction_guide)+ rules_for_edges = self.build_rules_for_edges(guide)if rules_for_edges:parts.append(rules_for_edges)@@ -139,15 +184,15 @@ class PromptBuilder:return "\n\n".join(parts)- def build_graph_node_prompt(self, extraction_guide: ExtractionGuide) -> str:+ def build_graph_node_prompt(self, guide: Guide) -> str:"""Build Graph type node extraction Prompt (two-stage mode)."""parts = []- target = self.build_target(extraction_guide)+ target = self.build_target(guide)if target:parts.append(target)- rules_for_nodes = self.build_rules_for_nodes(extraction_guide)+ rules_for_nodes = self.build_rules_for_nodes(guide)if rules_for_nodes:parts.append(rules_for_nodes)@@ -156,15 +201,15 @@ class PromptBuilder:return "\n\n".join(parts)- def build_graph_edge_prompt(self, extraction_guide: ExtractionGuide) -> str:+ def build_graph_edge_prompt(self, guide: Guide) -> str:"""Build Graph type edge extraction Prompt (two-stage mode)."""parts = []- target = self.build_target(extraction_guide)+ target = self.build_target(guide)if target:parts.append(target)- rules_for_edges = self.build_rules_for_edges(extraction_guide)+ rules_for_edges = self.build_rules_for_edges(guide)if rules_for_edges:parts.append(rules_for_edges)@@ -176,19 +221,19 @@ class PromptBuilder:return "\n\n".join(parts)- def build_temporal_graph_node_prompt(self, extraction_guide: ExtractionGuide) -> str:+ def build_temporal_graph_node_prompt(self, guide: Guide) -> str:"""Build TemporalGraph node extraction Prompt."""parts = []- target = self.build_target(extraction_guide)+ target = self.build_target(guide)if target:parts.append(target)- rules_for_nodes = self.build_rules_for_nodes(extraction_guide)+ rules_for_nodes = self.build_rules_for_nodes(guide)if rules_for_nodes:parts.append(rules_for_nodes)- rules_for_time = self.build_rules_for_time(extraction_guide)+ rules_for_time = self.build_rules_for_time(guide)if rules_for_time:parts.append(rules_for_time)@@ -197,19 +242,19 @@ class PromptBuilder:return "\n\n".join(parts)- def build_spatial_graph_node_prompt(self, extraction_guide: ExtractionGuide) -> str:+ def build_spatial_graph_node_prompt(self, guide: Guide) -> str:"""Build SpatialGraph node extraction Prompt."""parts = []- target = self.build_target(extraction_guide)+ target = self.build_target(guide)if target:parts.append(target)- rules_for_nodes = self.build_rules_for_nodes(extraction_guide)+ rules_for_nodes = self.build_rules_for_nodes(guide)if rules_for_nodes:parts.append(rules_for_nodes)- rules_for_location = self.build_rules_for_location(extraction_guide)+ rules_for_location = self.build_rules_for_location(guide)if rules_for_location:parts.append(rules_for_location)@@ -218,23 +263,23 @@ class PromptBuilder:return "\n\n".join(parts)- def build_spatio_temporal_graph_node_prompt(self, extraction_guide: ExtractionGuide) -> str:+ def build_spatio_temporal_graph_node_prompt(self, guide: Guide) -> str:"""Build SpatioTemporalGraph node extraction Prompt."""parts = []- target = self.build_target(extraction_guide)+ target = self.build_target(guide)if target:parts.append(target)- rules_for_nodes = self.build_rules_for_nodes(extraction_guide)+ rules_for_nodes = self.build_rules_for_nodes(guide)if rules_for_nodes:parts.append(rules_for_nodes)- rules_for_time = self.build_rules_for_time(extraction_guide)+ rules_for_time = self.build_rules_for_time(guide)if rules_for_time:parts.append(rules_for_time)- rules_for_location = self.build_rules_for_location(extraction_guide)+ rules_for_location = self.build_rules_for_location(guide)if rules_for_location:parts.append(rules_for_location)@@ -242,3 +287,10 @@ class PromptBuilder:parts.append(f"## {source_label}:\n{{source_text}}")return "\n\n".join(parts)+++__all__ = [+ "GuideTarget",+ "Guide",+ "PromptBuilder",+]diff --git a/hyperextract/utils/template_engine/identifier_resolver.py b/hyperextract/utils/template_engine/builder/identifiers.pysimilarity index 91%rename from hyperextract/utils/template_engine/identifier_resolver.pyrename to hyperextract/utils/template_engine/builder/identifiers.pyindex 4e39292..5677926 100644--- a/hyperextract/utils/template_engine/identifier_resolver.py+++ b/hyperextract/utils/template_engine/builder/identifiers.py@@ -1,14 +1,22 @@-"""Identifier Resolver - Generates extraction functions for nodes and edges.--Converts identifier definitions in configuration to callable functions.-"""+"""Identifier models and resolver."""from typing import Any, Callable, Dict, List, Optional, Tuple, Unionfrom pydantic import BaseModel+class Identifiers(BaseModel):+ """Identifier configuration."""++ item_id: Optional[str] = None+ node_id: Optional[str] = None+ edge_id: Optional[str] = None+ edge_members: Optional[Union[str, Dict[str, str], List[str]]] = None+ time_field: Optional[str] = None+ location_field: Optional[str] = None++class IdentifierResolver:- """Identifier Resolver."""+ """Identifier Resolver - Generates extraction functions for nodes and edges."""@staticmethoddef resolve_item_id(field_name: str) -> Callable[[BaseModel], str]:@@ -136,3 +144,9 @@ class IdentifierResolver:result["location_in_edge_extractor"] = cls.resolve_location(identifiers_dict["location_field"])return result+++__all__ = [+ "Identifiers",+ "IdentifierResolver",+]diff --git a/hyperextract/utils/template_engine/config_loader.py b/hyperextract/utils/template_engine/builder/loader.pysimilarity index 54%rename from hyperextract/utils/template_engine/config_loader.pyrename to hyperextract/utils/template_engine/builder/loader.pyindex 2619870..c600bfc 100644--- a/hyperextract/utils/template_engine/config_loader.py+++ b/hyperextract/utils/template_engine/builder/loader.py@@ -1,127 +1,13 @@-"""Config Loader - Loads and validates YAML configuration files.--Provides configuration schema definition, multilingual field parsing, and configuration validation.-"""+"""Config loader, parameters and display models."""from typing import Any, Dict, List, Literal, Optional, Unionfrom pathlib import Pathfrom pydantic import BaseModel, Field, field_validator, ConfigDictimport yaml--class FieldDescription(BaseModel):- """Field description with multilingual support."""-- zh: Optional[str] = None- en: Optional[str] = None-- def get(self, language: str = "zh") -> str:- """Get description for specified language."""- if isinstance(self, str):- return self- return getattr(self, language) or self.zh or ""---class SchemaField(BaseModel):- """Schema field definition."""-- name: str- type: Literal["string", "int", "float", "bool", "array"]- description: Optional[Union[str, Dict[str, str]]] = None- required: bool = False- default: Optional[Any] = None- item_type: Optional[str] = None-- @field_validator("description", mode="before")- @classmethod- def parse_description(cls, v):- """Parse description field, supports plain string or multilingual dict."""- return v---class BaseSchema(BaseModel):- """Base schema configuration."""-- fields: List[SchemaField] = Field(default_factory=list)---class ModelSchema(BaseSchema):- """Model type schema."""- pass---class ItemSchema(BaseSchema):- """List/Set type item schema."""- pass---class NodeSchema(BaseSchema):- """Graph type node schema."""- pass---class EdgeSchema(BaseSchema):- """Graph type edge schema."""- pass---class ExtractionGuideTarget(BaseModel):- """Extraction target with role definition and content description."""-- zh: Optional[str] = None- en: Optional[str] = None-- @classmethod- def from_value(cls, value: Union[str, Dict[str, str], None]) -> Optional["ExtractionGuideTarget"]:- """Create instance from string or dict."""- if value is None:- return None- if isinstance(value, str):- return cls(zh=value)- if isinstance(value, dict):- return cls(**value)- return None-- def get(self, language: str = "zh") -> str:- """Get content for specified language."""- return getattr(self, language) or self.zh or ""---class ExtractionGuide(BaseModel):- """Extraction guide configuration."""-- target: Optional[Union[str, List[str], Dict[str, Union[str, List[str]]]]] = None- rules: Optional[Union[List[str], Dict[str, List[str]]]] = None- rules_for_nodes: Optional[Union[List[str], Dict[str, List[str]]]] = None- rules_for_edges: Optional[Union[List[str], Dict[str, List[str]]]] = None- rules_for_time: Optional[Union[List[str], Dict[str, List[str]]]] = None- rules_for_location: Optional[Union[List[str], Dict[str, List[str]]]] = None-- def get_field(self, field_name: str, language: str = "zh") -> Optional[str]:- """Get specified field content for specified language."""- value = getattr(self, field_name, None)- if value is None:- return None- if isinstance(value, list):- return "\n".join(f"{i+1}. {item}" for i, item in enumerate(value))- if isinstance(value, dict):- dict_value = value.get(language) or value.get("zh")- if dict_value is None:- return None- if isinstance(dict_value, list):- return "\n".join(f"{i+1}. {item}" for i, item in enumerate(dict_value))- return None---class Identifiers(BaseModel):- """Identifier configuration."""-- item_id: Optional[str] = None- node_id: Optional[str] = None- edge_id: Optional[str] = None- edge_members: Optional[Union[str, Dict[str, str], List[str]]] = None- time_field: Optional[str] = None- location_field: Optional[str] = None+from .schema import ModelSchema, ItemSchema, NodeSchema, EdgeSchema+from .extraction import Guide+from .identifiers import Identifiersclass Parameters(BaseModel):@@ -183,7 +69,7 @@ class TemplateConfig(BaseModel):item_schema: Optional[ItemSchema] = Nonenode_schema: Optional[NodeSchema] = Noneedge_schema: Optional[EdgeSchema] = None- extraction_guide: Optional[ExtractionGuide] = None+ guide: Optional[Guide] = Noneidentifiers: Optional[Identifiers] = Noneparameters: Optional[Parameters] = Nonedisplay: Optional[Display] = None@@ -247,3 +133,11 @@ class ConfigLoader:"temporal_graph", "spatial_graph", "spatio_temporal_graph"}return autotype in valid_types+++__all__ = [+ "Parameters",+ "Display",+ "TemplateConfig",+ "ConfigLoader",+]diff --git a/hyperextract/utils/template_engine/schema_builder.py b/hyperextract/utils/template_engine/builder/schema.pysimilarity index 69%rename from hyperextract/utils/template_engine/schema_builder.pyrename to hyperextract/utils/template_engine/builder/schema.pyindex 4df0ec7..b4be810 100644--- a/hyperextract/utils/template_engine/schema_builder.py+++ b/hyperextract/utils/template_engine/builder/schema.py@@ -1,19 +1,63 @@-"""Schema Builder - Dynamically generates Pydantic Schema.+"""Schema models and builder."""-Converts Schema definitions in configuration files to Pydantic models.-"""+from typing import Any, Dict, List, Literal, Optional, Union, Type+from pydantic import BaseModel, Field, field_validator, create_model-from typing import Any, Dict, List, Optional, Type, Union, get_type_hints-from pydantic import BaseModel, Field, create_model-from pydantic.fields import FieldInfo-from .config_loader import (- SchemaField,- ModelSchema,- ItemSchema,- NodeSchema,- EdgeSchema,-)+class FieldDescription(BaseModel):+ """Field description with multilingual support."""++ zh: Optional[str] = None+ en: Optional[str] = None++ def get(self, language: str = "zh") -> str:+ """Get description for specified language."""+ if isinstance(self, str):+ return self+ return getattr(self, language) or self.zh or ""+++class SchemaField(BaseModel):+ """Schema field definition."""++ name: str+ type: Literal["string", "int", "float", "bool", "array"]+ description: Optional[Union[str, Dict[str, str]]] = None+ required: bool = False+ default: Optional[Any] = None+ item_type: Optional[str] = None++ @field_validator("description", mode="before")+ @classmethod+ def parse_description(cls, v):+ """Parse description field, supports plain string or multilingual dict."""+ return v+++class BaseSchema(BaseModel):+ """Base schema configuration."""++ fields: List[SchemaField] = Field(default_factory=list)+++class ModelSchema(BaseSchema):+ """Model type schema."""+ pass+++class ItemSchema(BaseSchema):+ """List/Set type item schema."""+ pass+++class NodeSchema(BaseSchema):+ """Graph type node schema."""+ pass+++class EdgeSchema(BaseSchema):+ """Graph type edge schema."""+ passTYPE_MAPPING = {@@ -26,7 +70,7 @@ TYPE_MAPPING = {class SchemaBuilder:- """Schema Builder."""+ """Schema Builder - Dynamically generates Pydantic Schema."""@staticmethoddef build_field_type(field: SchemaField) -> Type:@@ -126,3 +170,15 @@ class SchemaBuilder:result["edge_schema"] = cls.build_edge_schema(config.edge_schema)return result+++__all__ = [+ "FieldDescription",+ "SchemaField",+ "BaseSchema",+ "ModelSchema",+ "ItemSchema",+ "NodeSchema",+ "EdgeSchema",+ "SchemaBuilder",+]diff --git a/hyperextract/utils/template_engine/template_factory.py b/hyperextract/utils/template_engine/factory.pysimilarity index 94%rename from hyperextract/utils/template_engine/template_factory.pyrename to hyperextract/utils/template_engine/factory.pyindex e121daf..3e886e2 100644--- a/hyperextract/utils/template_engine/template_factory.py+++ b/hyperextract/utils/template_engine/factory.py@@ -21,10 +21,13 @@ from hyperextract.types import (AutoSpatioTemporalGraph,)-from .config_loader import TemplateConfig, Parameters-from .schema_builder import SchemaBuilder-from .identifier_resolver import IdentifierResolver-from .prompt_builder import PromptBuilder+from .builder import (+ TemplateConfig,+ Parameters,+ SchemaBuilder,+ IdentifierResolver,+ PromptBuilder,+)class TemplateFactory:@@ -98,9 +101,9 @@ class TemplateFactory:if schema_class is None:raise ValueError(f"AutoModel requires schema definition: {config.name}")- extraction_guide = config.extraction_guide+ guide = config.guideprompt_builder = PromptBuilder(language)- prompt = prompt_builder.build_model_prompt(extraction_guide)+ prompt = prompt_builder.build_model_prompt(guide)parameters = config.parameters or Parameters()merge_strategy = parameters.merge_strategy or "llm_balanced"@@ -135,9 +138,9 @@ class TemplateFactory:if item_schema_class is None:raise ValueError(f"AutoList requires item_schema definition: {config.name}")- extraction_guide = config.extraction_guide+ guide = config.guideprompt_builder = PromptBuilder(language)- prompt = prompt_builder.build_model_prompt(extraction_guide)+ prompt = prompt_builder.build_model_prompt(guide)parameters = config.parameters or Parameters()@@ -169,9 +172,9 @@ class TemplateFactory:if item_id_extractor is None:raise ValueError(f"AutoSet requires item_id configuration: {config.name}")- extraction_guide = config.extraction_guide+ guide = config.guideprompt_builder = PromptBuilder(language)- prompt = prompt_builder.build_model_prompt(extraction_guide)+ prompt = prompt_builder.build_model_prompt(guide)parameters = config.parameters or Parameters()merge_strategy = parameters.merge_strategy or "llm_balanced"@@ -216,19 +219,19 @@ class TemplateFactory:if not all([node_key_extractor, edge_key_extractor, nodes_in_edge_extractor]):raise ValueError(f"AutoGraph requires complete identifiers configuration: {config.name}")- extraction_guide = config.extraction_guide+ guide = config.guideprompt_builder = PromptBuilder(language)extraction_mode = config.parameters.extraction_mode if config.parameters else "two_stage"if extraction_mode == "one_stage":- prompt = prompt_builder.build_graph_main_prompt(extraction_guide)+ prompt = prompt_builder.build_graph_main_prompt(guide)prompt_for_node_extraction = ""prompt_for_edge_extraction = ""else:prompt = ""- prompt_for_node_extraction = prompt_builder.build_graph_node_prompt(extraction_guide)- prompt_for_edge_extraction = prompt_builder.build_graph_edge_prompt(extraction_guide)+ prompt_for_node_extraction = prompt_builder.build_graph_node_prompt(guide)+ prompt_for_edge_extraction = prompt_builder.build_graph_edge_prompt(guide)parameters = config.parameters or Parameters()@@ -297,19 +300,19 @@ class TemplateFactory:if not all([node_key_extractor, edge_key_extractor, nodes_in_edge_extractor]):raise ValueError(f"AutoTemporalGraph requires complete identifiers configuration: {config.name}")- extraction_guide = config.extraction_guide+ guide = config.guideprompt_builder = PromptBuilder(language)extraction_mode = config.parameters.extraction_mode if config.parameters else "two_stage"if extraction_mode == "one_stage":- prompt = prompt_builder.build_graph_main_prompt(extraction_guide)+ prompt = prompt_builder.build_graph_main_prompt(guide)prompt_for_node_extraction = ""prompt_for_edge_extraction = ""else:prompt = ""- prompt_for_node_extraction = prompt_builder.build_temporal_graph_node_prompt(extraction_guide)- prompt_for_edge_extraction = prompt_builder.build_graph_edge_prompt(extraction_guide)+ prompt_for_node_extraction = prompt_builder.build_temporal_graph_node_prompt(guide)+ prompt_for_edge_extraction = prompt_builder.build_graph_edge_prompt(guide)parameters = config.parameters or Parameters()@@ -375,19 +378,19 @@ class TemplateFactory:if not all([node_key_extractor, edge_key_extractor, nodes_in_edge_extractor]):raise ValueError(f"AutoSpatialGraph requires complete identifiers configuration: {config.name}")- extraction_guide = config.extraction_guide+ guide = config.guideprompt_builder = PromptBuilder(language)extraction_mode = config.parameters.extraction_mode if config.parameters else "two_stage"if extraction_mode == "one_stage":- prompt = prompt_builder.build_graph_main_prompt(extraction_guide)+ prompt = prompt_builder.build_graph_main_prompt(guide)prompt_for_node_extraction = ""prompt_for_edge_extraction = ""else:prompt = ""- prompt_for_node_extraction = prompt_builder.build_spatial_graph_node_prompt(extraction_guide)- prompt_for_edge_extraction = prompt_builder.build_graph_edge_prompt(extraction_guide)+ prompt_for_node_extraction = prompt_builder.build_spatial_graph_node_prompt(guide)+ prompt_for_edge_extraction = prompt_builder.build_graph_edge_prompt(guide)parameters = config.parameters or Parameters()@@ -454,19 +457,19 @@ class TemplateFactory:if not all([node_key_extractor, edge_key_extractor, nodes_in_edge_extractor]):raise ValueError(f"AutoSpatioTemporalGraph requires complete identifiers configuration: {config.name}")- extraction_guide = config.extraction_guide+ guide = config.guideprompt_builder = PromptBuilder(language)extraction_mode = config.parameters.extraction_mode if config.parameters else "two_stage"if extraction_mode == "one_stage":- prompt = prompt_builder.build_graph_main_prompt(extraction_guide)+ prompt = prompt_builder.build_graph_main_prompt(guide)prompt_for_node_extraction = ""prompt_for_edge_extraction = ""else:prompt = ""- prompt_for_node_extraction = prompt_builder.build_spatio_temporal_graph_node_prompt(extraction_guide)- prompt_for_edge_extraction = prompt_builder.build_graph_edge_prompt(extraction_guide)+ prompt_for_node_extraction = prompt_builder.build_spatio_temporal_graph_node_prompt(guide)+ prompt_for_edge_extraction = prompt_builder.build_graph_edge_prompt(guide)parameters = config.parameters or Parameters()@@ -557,7 +560,6 @@ class TemplateFactory:"""# Merge parameters: user-provided kwargs have highest priorityif kwargs:- from .config_loader import Parametersbase_params = config.parameters or Parameters()params_dict = base_params.model_dump()params_dict.update(kwargs)diff --git a/hyperextract/utils/template_engine/template_gallery.py b/hyperextract/utils/template_engine/gallery.pysimilarity index 73%rename from hyperextract/utils/template_engine/template_gallery.pyrename to hyperextract/utils/template_engine/gallery.pyindex 2e6181a..a349ab7 100644--- a/hyperextract/utils/template_engine/template_gallery.py+++ b/hyperextract/utils/template_engine/gallery.py@@ -7,7 +7,7 @@ import osfrom pathlib import Pathfrom typing import Dict, List, Optional-from .config_loader import TemplateConfig, ConfigLoader+from .builder import TemplateConfig, ConfigLoaderclass Gallery:@@ -167,6 +167,74 @@ class Gallery:domains.append((item.name, count))return domains+ @classmethod+ def create(+ cls,+ name: str,+ lang: str = "zh",+ llm_client=None,+ embedder=None,+ ):+ """Create template instance.++ Args:+ name: Template name (e.g., "knowledge_graph", "zh/finance/risk_assessment")+ lang: Language, default "zh"+ llm_client: LLM client, optional, reads from global config if not provided+ embedder: Embedder client, optional, reads from global config if not provided++ Returns:+ TemplateWrapper instance++ Examples:+ # Method 1: Use global config (recommended)+ template = Gallery.create("knowledge_graph")++ # Method 2: Custom client+ from hyperextract.utils import get_client+ llm, emb = get_client()+ template = Gallery.create("knowledge_graph", llm_client=llm, embedder=emb)++ # Method 3: Mixed usage+ template = Gallery.create("knowledge_graph", llm_client=my_llm)+ """+ config = cls._resolve_config(name, lang)++ if llm_client is None or embedder is None:+ from hyperextract.utils import get_client+ default_llm, default_emb = get_client()+ llm_client = llm_client or default_llm+ embedder = embedder or default_emb++ from .factory import TemplateFactory+ return TemplateFactory.create(config, llm_client, embedder)++ @classmethod+ def _resolve_config(cls, name: str, lang: str = "zh") -> TemplateConfig:+ """Resolve template name to config object."""+ config = cls.get(name)+ if config is not None:+ return config++ parts = name.split("/")+ if len(parts) == 1:+ search_name = f"{lang}/{name}"+ config = cls.get(search_name)+ if config is not None:+ return config+ else:+ template_lang = parts[0]+ if template_lang not in ["zh", "en"]:+ template_lang = lang+ template_name = parts[-1]+ full_name = f"{template_lang}/{template_name}"+ config = cls.get(full_name)+ if config is not None:+ return config++ available = cls.list_all()+ raise ValueError(f"Template '{name}' not found. Available: {available[:10]}...")+def _load_config(self, file_path: Path) -> None:try:config = ConfigLoader.load_config(file_path)diff --git a/hyperextract/utils/template_engine/template.py b/hyperextract/utils/template_engine/template.pynew file mode 100644index 0000000..84d36a4--- /dev/null+++ b/hyperextract/utils/template_engine/template.py@@ -0,0 +1,88 @@+"""Template - Unified template API."""++from .gallery import Gallery+++class Template:+ """Unified template API for searching and creating templates.++ Examples:+ # List all templates+ Template.list()++ # Search templates+ Template.search("知识图谱")+ Template.search(autotype="graph")++ # Get template config+ config = Template.get("knowledge_graph")++ # Create template (auto reads from global config)+ template = Template.create("knowledge_graph")++ # Create with custom clients+ template = Template.create("knowledge_graph", llm_client=llm, embedder=emb)+ """++ @staticmethod+ def list():+ """List all available template names."""+ return Gallery.list_all()++ @staticmethod+ def search(query=None, autotype=None, tag=None, language=None):+ """Search templates by criteria.++ Args:+ query: Search in template name/description+ autotype: Filter by autotype (e.g., "graph", "list")+ tag: Filter by tag+ language: Filter by language (e.g., "zh", "en")++ Returns:+ List of TemplateConfig+ """+ return Gallery.search(query, autotype, tag, language)++ @staticmethod+ def get(name, lang="zh"):+ """Get template config by name.++ Args:+ name: Template name+ lang: Language++ Returns:+ TemplateConfig+ """+ return Gallery._resolve_config(name, lang)++ @staticmethod+ def create(name, lang="zh", llm_client=None, embedder=None):+ """Create template instance.++ If llm_client or embedder is not provided, automatically reads+ from global config (~/.he/config.toml).++ Args:+ name: Template name (e.g., "knowledge_graph", "zh/finance/risk_assessment")+ lang: Language, default "zh"+ llm_client: LLM client, optional+ embedder: Embedder client, optional++ Returns:+ TemplateWrapper instance+ """+ return Gallery.create(name, lang, llm_client, embedder)++ @staticmethod+ def domains():+ """List available domains with template count.++ Returns:+ List of (domain_name, template_count) tuples+ """+ return Gallery.list_domains()+++__all__ = ["Template"]diff --git a/pyproject.toml b/pyproject.tomlindex 8d3582a..63b962e 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -40,7 +40,6 @@ dependencies = [# cli dependencies"typer>=0.13.0","rich>=13.7.0",- "tomli>=2.0.1","tomli-w>=1.0.0",]@@ -53,6 +52,13 @@ dev = []+[project.optional-dependencies]+anthropic = ["langchain-anthropic>=0.3.0"]+google = ["langchain-google-genai>=2.1.0"]+all = [+ "hyperextract[anthropic,google]",+]+[project.urls]Homepage = "https://github.com/yifanfeng97/hyper-extract"Repository = "https://github.com/yifanfeng97/hyper-extract"diff --git a/tests/fixtures/test_samples/legacy/agriculture/crop_technical_manual.md b/tests/test_data/test_samples/legacy/agriculture/crop_technical_manual.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/agriculture/crop_technical_manual.mdrename to tests/test_data/test_samples/legacy/agriculture/crop_technical_manual.mddiff --git a/tests/fixtures/test_samples/legacy/agriculture/field_scouting_report.md b/tests/test_data/test_samples/legacy/agriculture/field_scouting_report.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/agriculture/field_scouting_report.mdrename to tests/test_data/test_samples/legacy/agriculture/field_scouting_report.mddiff --git a/tests/fixtures/test_samples/legacy/agriculture/soil_analysis_report.md b/tests/test_data/test_samples/legacy/agriculture/soil_analysis_report.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/agriculture/soil_analysis_report.mdrename to tests/test_data/test_samples/legacy/agriculture/soil_analysis_report.mddiff --git a/tests/fixtures/test_samples/legacy/biology/glycolysis_pathway.md b/tests/test_data/test_samples/legacy/biology/glycolysis_pathway.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/biology/glycolysis_pathway.mdrename to tests/test_data/test_samples/legacy/biology/glycolysis_pathway.mddiff --git a/tests/fixtures/test_samples/legacy/biology/lake_ecosystem.md b/tests/test_data/test_samples/legacy/biology/lake_ecosystem.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/biology/lake_ecosystem.mdrename to tests/test_data/test_samples/legacy/biology/lake_ecosystem.mddiff --git a/tests/fixtures/test_samples/legacy/biology/protein_signal_complex.md b/tests/test_data/test_samples/legacy/biology/protein_signal_complex.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/biology/protein_signal_complex.mdrename to tests/test_data/test_samples/legacy/biology/protein_signal_complex.mddiff --git a/tests/fixtures/test_samples/legacy/biology/wetland_survey.md b/tests/test_data/test_samples/legacy/biology/wetland_survey.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/biology/wetland_survey.mdrename to tests/test_data/test_samples/legacy/biology/wetland_survey.mddiff --git a/tests/fixtures/test_samples/legacy/food/food_review_article.md b/tests/test_data/test_samples/legacy/food/food_review_article.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/food/food_review_article.mdrename to tests/test_data/test_samples/legacy/food/food_review_article.mddiff --git a/tests/fixtures/test_samples/legacy/food/multi_recipe_card.md b/tests/test_data/test_samples/legacy/food/multi_recipe_card.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/food/multi_recipe_card.mdrename to tests/test_data/test_samples/legacy/food/multi_recipe_card.mddiff --git a/tests/fixtures/test_samples/legacy/food/recipe_standard_card.md b/tests/test_data/test_samples/legacy/food/recipe_standard_card.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/food/recipe_standard_card.mdrename to tests/test_data/test_samples/legacy/food/recipe_standard_card.mddiff --git a/tests/fixtures/test_samples/legacy/food/restaurant_menu.md b/tests/test_data/test_samples/legacy/food/restaurant_menu.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/food/restaurant_menu.mdrename to tests/test_data/test_samples/legacy/food/restaurant_menu.mddiff --git a/tests/fixtures/test_samples/legacy/history/battle_of_chibi.md b/tests/test_data/test_samples/legacy/history/battle_of_chibi.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/history/battle_of_chibi.mdrename to tests/test_data/test_samples/legacy/history/battle_of_chibi.mddiff --git a/tests/fixtures/test_samples/legacy/history/sushi_life_letters.md b/tests/test_data/test_samples/legacy/history/sushi_life_letters.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/history/sushi_life_letters.mdrename to tests/test_data/test_samples/legacy/history/sushi_life_letters.mddiff --git a/tests/fixtures/test_samples/legacy/literature/critique_zhenhuan.md b/tests/test_data/test_samples/legacy/literature/critique_zhenhuan.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/literature/critique_zhenhuan.mdrename to tests/test_data/test_samples/legacy/literature/critique_zhenhuan.mddiff --git a/tests/fixtures/test_samples/legacy/literature/novel_langya.md b/tests/test_data/test_samples/legacy/literature/novel_langya.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/literature/novel_langya.mdrename to tests/test_data/test_samples/legacy/literature/novel_langya.mddiff --git a/tests/fixtures/test_samples/legacy/literature/screenplay_zhenhuan.md b/tests/test_data/test_samples/legacy/literature/screenplay_zhenhuan.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/literature/screenplay_zhenhuan.mdrename to tests/test_data/test_samples/legacy/literature/screenplay_zhenhuan.mddiff --git a/tests/fixtures/test_samples/legacy/news/__init__.py b/tests/test_data/test_samples/legacy/news/__init__.pysimilarity index 100%rename from tests/fixtures/test_samples/legacy/news/__init__.pyrename to tests/test_data/test_samples/legacy/news/__init__.pydiff --git a/tests/fixtures/test_samples/legacy/news/breaking_news_brief.md b/tests/test_data/test_samples/legacy/news/breaking_news_brief.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/news/breaking_news_brief.mdrename to tests/test_data/test_samples/legacy/news/breaking_news_brief.mddiff --git a/tests/fixtures/test_samples/legacy/news/investigative_report.md b/tests/test_data/test_samples/legacy/news/investigative_report.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/news/investigative_report.mdrename to tests/test_data/test_samples/legacy/news/investigative_report.mddiff --git a/tests/fixtures/test_samples/legacy/news/live_event_updates.md b/tests/test_data/test_samples/legacy/news/live_event_updates.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/news/live_event_updates.mdrename to tests/test_data/test_samples/legacy/news/live_event_updates.mddiff --git a/tests/fixtures/test_samples/legacy/news/policy_analysis.md b/tests/test_data/test_samples/legacy/news/policy_analysis.mdsimilarity index 100%rename from tests/fixtures/test_samples/legacy/news/policy_analysis.mdrename to tests/test_data/test_samples/legacy/news/policy_analysis.mddiff --git a/tests/fixtures/test_samples/zh/finance/annual_report_sample.md b/tests/test_data/test_samples/zh/finance/annual_report_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/finance/annual_report_sample.mdrename to tests/test_data/test_samples/zh/finance/annual_report_sample.mddiff --git a/tests/fixtures/test_samples/zh/finance/earnings_call_transcript_sample.md b/tests/test_data/test_samples/zh/finance/earnings_call_transcript_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/finance/earnings_call_transcript_sample.mdrename to tests/test_data/test_samples/zh/finance/earnings_call_transcript_sample.mddiff --git a/tests/fixtures/test_samples/zh/finance/equity_research_report_sample.md b/tests/test_data/test_samples/zh/finance/equity_research_report_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/finance/equity_research_report_sample.mdrename to tests/test_data/test_samples/zh/finance/equity_research_report_sample.mddiff --git a/tests/fixtures/test_samples/zh/finance/financial_news_sample.md b/tests/test_data/test_samples/zh/finance/financial_news_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/finance/financial_news_sample.mdrename to tests/test_data/test_samples/zh/finance/financial_news_sample.mddiff --git a/tests/fixtures/test_samples/zh/finance/ipo_prospectus_sample.md b/tests/test_data/test_samples/zh/finance/ipo_prospectus_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/finance/ipo_prospectus_sample.mdrename to tests/test_data/test_samples/zh/finance/ipo_prospectus_sample.mddiff --git a/tests/fixtures/test_samples/zh/finance/supply_chain_analysis_sample.md b/tests/test_data/test_samples/zh/finance/supply_chain_analysis_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/finance/supply_chain_analysis_sample.mdrename to tests/test_data/test_samples/zh/finance/supply_chain_analysis_sample.mddiff --git a/tests/fixtures/test_samples/zh/general/arbitrary_tech_news.md b/tests/test_data/test_samples/zh/general/arbitrary_tech_news.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/general/arbitrary_tech_news.mdrename to tests/test_data/test_samples/zh/general/arbitrary_tech_news.mddiff --git a/tests/fixtures/test_samples/zh/general/biography_scientist.md b/tests/test_data/test_samples/zh/general/biography_scientist.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/general/biography_scientist.mdrename to tests/test_data/test_samples/zh/general/biography_scientist.mddiff --git a/tests/fixtures/test_samples/zh/general/encyclopedia_machine_learning.md b/tests/test_data/test_samples/zh/general/encyclopedia_machine_learning.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/general/encyclopedia_machine_learning.mdrename to tests/test_data/test_samples/zh/general/encyclopedia_machine_learning.mddiff --git a/tests/fixtures/test_samples/zh/general/regulation_company_policy.md b/tests/test_data/test_samples/zh/general/regulation_company_policy.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/general/regulation_company_policy.mdrename to tests/test_data/test_samples/zh/general/regulation_company_policy.mddiff --git a/tests/fixtures/test_samples/zh/industry/equipment_technical_manual.md b/tests/test_data/test_samples/zh/industry/equipment_technical_manual.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/industry/equipment_technical_manual.mdrename to tests/test_data/test_samples/zh/industry/equipment_technical_manual.mddiff --git a/tests/fixtures/test_samples/zh/industry/failure_analysis_report.md b/tests/test_data/test_samples/zh/industry/failure_analysis_report.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/industry/failure_analysis_report.mdrename to tests/test_data/test_samples/zh/industry/failure_analysis_report.mddiff --git a/tests/fixtures/test_samples/zh/industry/operation_maintenance_manual.md b/tests/test_data/test_samples/zh/industry/operation_maintenance_manual.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/industry/operation_maintenance_manual.mdrename to tests/test_data/test_samples/zh/industry/operation_maintenance_manual.mddiff --git a/tests/fixtures/test_samples/zh/industry/safety_management_handbook.md b/tests/test_data/test_samples/zh/industry/safety_management_handbook.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/industry/safety_management_handbook.mdrename to tests/test_data/test_samples/zh/industry/safety_management_handbook.mddiff --git a/tests/fixtures/test_samples/zh/legal/compliance_filing_sample.md b/tests/test_data/test_samples/zh/legal/compliance_filing_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/legal/compliance_filing_sample.mdrename to tests/test_data/test_samples/zh/legal/compliance_filing_sample.mddiff --git a/tests/fixtures/test_samples/zh/legal/court_judgment_sample.md b/tests/test_data/test_samples/zh/legal/court_judgment_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/legal/court_judgment_sample.mdrename to tests/test_data/test_samples/zh/legal/court_judgment_sample.mddiff --git a/tests/fixtures/test_samples/zh/legal/legal_treatise_sample.md b/tests/test_data/test_samples/zh/legal/legal_treatise_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/legal/legal_treatise_sample.mdrename to tests/test_data/test_samples/zh/legal/legal_treatise_sample.mddiff --git a/tests/fixtures/test_samples/zh/legal/msa_contract_sample.md b/tests/test_data/test_samples/zh/legal/msa_contract_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/legal/msa_contract_sample.mdrename to tests/test_data/test_samples/zh/legal/msa_contract_sample.mddiff --git a/tests/fixtures/test_samples/zh/medicine/clinical_guideline_sample.md b/tests/test_data/test_samples/zh/medicine/clinical_guideline_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/medicine/clinical_guideline_sample.mdrename to tests/test_data/test_samples/zh/medicine/clinical_guideline_sample.mddiff --git a/tests/fixtures/test_samples/zh/medicine/discharge_summary_sample.md b/tests/test_data/test_samples/zh/medicine/discharge_summary_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/medicine/discharge_summary_sample.mdrename to tests/test_data/test_samples/zh/medicine/discharge_summary_sample.mddiff --git a/tests/fixtures/test_samples/zh/medicine/package_insert_sample.md b/tests/test_data/test_samples/zh/medicine/package_insert_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/medicine/package_insert_sample.mdrename to tests/test_data/test_samples/zh/medicine/package_insert_sample.mddiff --git a/tests/fixtures/test_samples/zh/medicine/pathology_report_sample.md b/tests/test_data/test_samples/zh/medicine/pathology_report_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/medicine/pathology_report_sample.mdrename to tests/test_data/test_samples/zh/medicine/pathology_report_sample.mddiff --git a/tests/fixtures/test_samples/zh/medicine/textbook_sample.md b/tests/test_data/test_samples/zh/medicine/textbook_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/medicine/textbook_sample.mdrename to tests/test_data/test_samples/zh/medicine/textbook_sample.mddiff --git a/tests/fixtures/test_samples/zh/tcm/herb_property_single.md b/tests/test_data/test_samples/zh/tcm/herb_property_single.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/tcm/herb_property_single.mdrename to tests/test_data/test_samples/zh/tcm/herb_property_single.mddiff --git a/tests/fixtures/test_samples/zh/tcm/herbal_compendium_sample.md b/tests/test_data/test_samples/zh/tcm/herbal_compendium_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/tcm/herbal_compendium_sample.mdrename to tests/test_data/test_samples/zh/tcm/herbal_compendium_sample.mddiff --git a/tests/fixtures/test_samples/zh/tcm/medical_case_record_sample.md b/tests/test_data/test_samples/zh/tcm/medical_case_record_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/tcm/medical_case_record_sample.mdrename to tests/test_data/test_samples/zh/tcm/medical_case_record_sample.mddiff --git a/tests/fixtures/test_samples/zh/tcm/meridian_treatise_sample.md b/tests/test_data/test_samples/zh/tcm/meridian_treatise_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/tcm/meridian_treatise_sample.mdrename to tests/test_data/test_samples/zh/tcm/meridian_treatise_sample.mddiff --git a/tests/fixtures/test_samples/zh/tcm/prescription_formulary_sample.md b/tests/test_data/test_samples/zh/tcm/prescription_formulary_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/tcm/prescription_formulary_sample.mdrename to tests/test_data/test_samples/zh/tcm/prescription_formulary_sample.mddiff --git a/tests/fixtures/test_samples/zh/tcm/prescription_modification_sample.md b/tests/test_data/test_samples/zh/tcm/prescription_modification_sample.mdsimilarity index 100%rename from tests/fixtures/test_samples/zh/tcm/prescription_modification_sample.mdrename to tests/test_data/test_samples/zh/tcm/prescription_modification_sample.md