Hypergraph is more powerful. Transform unstructured text into structured knowledge with LLMs. Graphs, hypergraphs, and spatio-temporal extractions — with one command.
feat: 更新 README 文档,优化通用知识图谱模板描述,增加金融领域模板及应用场景
yifanfeng97884d58392a1c
diff --git a/hyperextract/templates/README.md b/hyperextract/templates/README.mdindex 97f1d0f..98723c5 100644--- a/hyperextract/templates/README.md+++ b/hyperextract/templates/README.md@@ -30,13 +30,15 @@ This library is organized by **Domain**, ensuring that the extraction logic matcThe default choice for unstructured text that doesn't fit a specific industry.* **Arbitrary Text (Universal Extraction)**: Any type of text (e.g., web content, notes, blogs) for direct entity and relationship extraction.+| Template Name | Primitive | Description | Typical Use Case || :--- | :--- | :--- | :--- |-| **`KnowledgeGraph`** | `AutoGraph` | **General Knowledge Graph**. Extracts entities and SPO relations using a broad, universal schema. | Open-domain text, web pages |+| **`KnowledgeGraph`** | `AutoGraph` | **General Knowledge Graph**. Extracts entities and relations using a broad, universal schema. | Open-domain text, web pages || **`EntityRegistry`** | `AutoSet` | **Entity Registry**. Deduplicates and compiles a list of unique entities (People, Organizations). | Entity collection, NER tasks || **`KeywordList`** | `AutoList` | **Keyword List**. Extracts core concepts, main topics, or tags from the text. | Content indexing, tagging |* **Wikipedia Articles / Encyclopedias**: Comprehensive descriptions of entities with structured infobox-like attributes.+| Template Name | Primitive | Description | Typical Use Case || :--- | :--- | :--- | :--- || **`EncyclopediaItem`** | `AutoModel` | **Encyclopedia Profile**. Extracts a structured profile for a single main entity (infobox style). | Wiki pages, dictionary entries |@@ -44,6 +46,7 @@ The default choice for unstructured text that doesn't fit a specific industry.| **`CrossReferenceNet`** | `AutoGraph` | **Cross-Reference Net**. Maps hyperlinks and citations between different concepts. | Inter-article navigation maps |* **Biographies & Memoirs**: Life stories of individuals, focusing on key life events and relationships.+| Template Name | Primitive | Description | Typical Use Case || :--- | :--- | :--- | :--- || **`LifeEventTimeline`** | `AutoTemporalGraph` | **Life Timeline**. Extracts life events with timestamps, sorted chronologically. | Biographies, annals, diaries |@@ -51,6 +54,7 @@ The default choice for unstructured text that doesn't fit a specific industry.| **`PersonalProfile`** | `AutoModel` | **Personal Bio**. Aggregates static personal attributes (birth, education, career tags). | Profiles, CVs, obituary summaries |* **Non-fiction Books (Popular Science)**: Books covering broad topics with cross-domain concepts and arguments.+| Template Name | Primitive | Description | Typical Use Case || :--- | :--- | :--- | :--- || **`ArgumentMap`** | `AutoHypergraph` | **Logical Argument Map**. Models complex logic: multiple premises supporting a conclusion. | Philosophical/Scientific books |@@ -58,11 +62,40 @@ The default choice for unstructured text that doesn't fit a specific industry.### 2. `finance` (Finance)Optimized for complex financial relationships, market sentiment, and temporal events.-* **Equity Research Reports**: Detailed analysis by analysts containing ratings (Buy/Sell), target prices, valuation logic, and risk factors.-* **Earnings Call Transcripts**: Dialogue between management and analysts, rich in non-structured performance attribution and strategic outlook.-* **Prospectuses / IPO Filings (S-1)**: Comprehensive disclosures of company history, shareholder structure, and use of proceeds prior to listing.++* **Equity Research Reports**: Detailed analysis by analysts containing ratings, target prices, and valuation logic.++| Template Name | Primitive | Description | Typical Use Case |+| :--- | :--- | :--- | :--- |+| **`ResearchNoteSummary`** | `AutoModel` | **Research Core**. Extracts ratings (Buy/Sell), target price, and top-level investment logic. | Report database, screening |+| **`FinancialForecast`** | `AutoList` | **Financial Estimates**. Extracts projected data (Revenue, EPS, PE) for future years. | Consensus analysis, modeling |+| **`ValuationLogicMap`** | `AutoGraph` | **Valuation Logic**. Maps causal chains driving stock performance (e.g., New Market -> Growth). | Investment strategy mapping |+| **`RiskFactorList`** | `AutoList` | **Risk Registry**. Lists specific downside risks (Regulatory, FX, Supply Chain). | Risk monitoring, negatives scan |++* **Earnings Call Transcripts**: Dialogue between management and analysts, rich in performance attribution and strategic outlook.++| Template Name | Primitive | Description | Typical Use Case |+| :--- | :--- | :--- | :--- |+| **`QAExtraction`** | `AutoList` | **Q&A Pairs**. Structures unstructured dialogue into Question-Answer-Speaker sets. | Meeting summaries, sentiment |+| **`GuidanceTracker`** | `AutoModel` | **Outlook Guidance**. Specifically targets quantitative forward-looking guidance (Revenue/Capex). | Expectation management |+| **`PerformanceAttribution`** | `AutoGraph` | **Performance Attribution**. Maps reasons for past performance (e.g., Inflation -> Margin Squeeze). | Attribution analysis |++* **Prospectuses / IPO Filings (S-1)**: Comprehensive disclosures of company history, shareholder structure, and use of proceeds.++| Template Name | Primitive | Description | Typical Use Case |+| :--- | :--- | :--- | :--- |+| **`ShareholderStructure`** | `AutoGraph` | **Ownership Graph**. Extracts percentages, controlling paths, and parent-subsidiary relations. | Ultimate controller analysis |+| **`ProceedsUsage`** | `AutoList` | **Fund Usage**. Details project names, allocated amounts, and estimated timelines for proceeds. | Post-IPO monitoring |+| **`CompanyHistoryTimeline`** | `AutoTemporalGraph` | **Corporate Milestones**. Chronological extraction of founding, funding rounds, and major pivots. | Due diligence, history mapping |+* **M&A Due Diligence Reports**: Documents detailing legal risks, business synergies, and financial health of target companies.+| Template Name | Primitive | Description | Typical Use Case |+| :--- | :--- | :--- | :--- |+| **`SynergyMap`** | `AutoGraph` | **Synergy Network**. Analyzes complementary relationships between Acquirer and Target. | Value creation assessment |+| **`LegalRiskRegistry`** | `AutoSet` | **Legal Encumbrances**. Deduplicates and lists pending litigations, compliance gaps, and IP disputes. | Risk clearing, valuation haircut |+| **`KeyPersonnelProfile`** | `AutoModel` | **Management Profiles**. Extracts backgrounds, non-competes, and retention plans of target leadership. | Human capital assessment |+### 3. `medicine` (Medicine)Focuses on causality, standardized terminology (UMLS mappings), and precise relationships.* **Medical Textbooks & Monographs**: Systematized knowledge of anatomy, pathology, and treatment protocols (e.g., "Principles of Neural Science").diff --git a/hyperextract/templates/README_ZH.md b/hyperextract/templates/README_ZH.mdindex e55ba06..e66e5a6 100644--- a/hyperextract/templates/README_ZH.md+++ b/hyperextract/templates/README_ZH.md@@ -30,10 +30,10 @@适用于无法归类或多领域交叉的文本,通过提取基础实体和SPO关系构建通用图谱。* **任意文本 (通用提取)**:适用于任何类型的文本(如网页内容、日常笔记、博客文章),直接提取其中的实体及关系。-*+| 模板名称 | 底层原语 | 描述 | 典型应用场景 || :--- | :--- | :--- | :--- |-| **`KnowledgeGraph`** | `AutoGraph` | **通用知识图谱**。使用通用的 Schema 提取实体与 SPO 关系。 | 任意文本、网页抓取内容 |+| **`KnowledgeGraph`** | `AutoGraph` | **通用知识图谱**。使用通用的 Schema 提取实体与关系。 | 任意文本、网页抓取内容 || **`EntityRegistry`** | `AutoSet` | **实体注册表**。去重并汇总文本中出现的所有唯一实体(如人名、机构)。 | 实体发现、命名实体识别 || **`KeywordList`** | `AutoList` | **关键词列表**。提取文本的核心概念、重要主题或标签。 | 内容打标、索引生成 |@@ -62,11 +62,40 @@### 2. `finance` (金融)专注于提取复杂的交易关系、市场观点及时间敏感事件。-* **股票研究报告 (Equity Research)**:分析师撰写的深度报告,包含评级(买入/卖出)、目标价、估值模型及风险提示。-* **业绩电话会实录 (Earnings Call Transcripts)**:管理层与分析师的问答记录,包含非结构化的业绩归因及前瞻性指引。-* **招股说明书 (Prospectus/IPO)**:企业上市前的全面披露文件,详述股权结构、募集资金用途及关联交易。++* **股票研究报告 (Equity Research)**:分析师撰写的深度报告,包含评级、目标价及投资逻辑相关内容。++| 模板名称 | 底层原语 | 描述 | 典型应用场景 |+| :--- | :--- | :--- | :--- |+| **`ResearchNoteSummary`** | `AutoModel` | **研报核心摘要**。提取评级(买入/卖出)、目标价及核心投资逻辑摘要。 | 研报数据库、快速筛选 |+| **`FinancialForecast`** | `AutoList` | **财务预测表**。提取分析师对未来几年的营收、EPS、PE 等关键指标预测。 | 一致性预期分析、估值建模 |+| **`ValuationLogicMap`** | `AutoGraph` | **估值逻辑图**。提取驱动股价变化的因果链条(如:新产品发布 -> 营收增长)。 | 投资逻辑图志、归因分析 |+| **`RiskFactorList`** | `AutoList` | **风险清单**。提取报告中的具体下行风险点(监管、汇率、供应链风险等)。 | 风险监控、负面因素扫描 |++* **业绩电话会实录 (Earnings Call Transcripts)**:管理层与分析师的问答记录,包含业绩归因及前瞻性指引。++| 模板名称 | 底层原语 | 描述 | 典型应用场景 |+| :--- | :--- | :--- | :--- |+| **`QAExtraction`** | `AutoList` | **问答对提取**。将非结构化对话整理为结构化的 问题-回答人-回答摘要。 | 纪要整理、多维观点比对 |+| **`GuidanceTracker`** | `AutoModel` | **业绩指引追踪**。专门提取管理层给出的未来业绩承诺或定量展望数据。 | 预期管理、模型更新 |+| **`PerformanceAttribution`** | `AutoGraph` | **业绩归因图**。提取业绩波动背后的原因(如:原料涨价 -> 毛利受到挤压)。 | 经营分析、趋势判断 |++* **招股说明书 (Prospectus/IPO)**:企业上市前的全面披露文件,详述股权结构、募集资金用途等。++| 模板名称 | 底层原语 | 描述 | 典型应用场景 |+| :--- | :--- | :--- | :--- |+| **`ShareholderStructure`** | `AutoGraph` | **股权结构图**。提取股东占比、层级关系及最终实际控制人路径。 | 穿透式监管、关联方识别 |+| **`ProceedsUsage`** | `AutoList` | **募资投向**。详细提取募投项目的名称、计划金额分配及预计时间表。 | 投后管理、资金使用合规 |+| **`CompanyHistoryTimeline`** | `AutoTemporalGraph` | **公司大事记**。按时间轴提取公司成立以来的融资、并购、管理层变更等里程碑。 | 投研尽调、企业图鉴 |+* **并购尽职调查报告 (Due Diligence)**:详述目标公司的法律风险、业务协同效应及财务健康状况。+| 模板名称 | 底层原语 | 描述 | 典型应用场景 |+| :--- | :--- | :--- | :--- |+| **`SynergyMap`** | `AutoGraph` | **协同效应网络**。分析并购双方在业务板块、技术或市场上的互补关系。 | 并购价值评估、反垄断分析 |+| **`LegalRiskRegistry`** | `AutoSet` | **法律风险登记册**。去重汇总所有未决诉讼、合规漏洞及知识产权争议记录。 | 风险排查、估值打折计算 |+| **`KeyPersonnelProfile`** | `AutoModel` | **核心团队画像**。提取目标公司关键管理人员的背景、竞业条款及留任计划。 | 组织尽调、人才保留计划 |+### 3. `medicine` (医学)专注于疾病诊疗逻辑、标准化术语映射及因果关系提取。* **医学教科书与专著**:系统性阐述解剖、病理、药理及治疗原则的专业书籍(如《神经科学原理》)。