Hypergraph is more powerful. Transform unstructured text into structured knowledge with LLMs. Graphs, hypergraphs, and spatio-temporal extractions — with one command.
feat: 更新 README 文档,增加通用领域的知识图谱模板及说明,优化文本提取示例
yifanfeng97835fdc17615a
diff --git a/hyperextract/templates/README.md b/hyperextract/templates/README.mdindex 0f7b5ca..97f1d0f 100644--- a/hyperextract/templates/README.md+++ b/hyperextract/templates/README.md@@ -28,10 +28,33 @@ This library is organized by **Domain**, ensuring that the extraction logic matc### 1. `general` (General Purpose)The 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 without specific domain constraints.++* **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 |+| **`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 |+| **`ConceptHierarchy`** | `AutoGraph` | **Concept Hierarchy**. Builds a taxonomy graph (Subclass-Of, Part-Of relations). | Scientific wikis, textbook units |+| **`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.-* **Non-fiction Books (Popular Science)**: Books that cover broad topics (e.g., "Sapiens", "Thinking, Fast and Slow") with cross-domain concepts and arguments.+| Template Name | Primitive | Description | Typical Use Case |+| :--- | :--- | :--- | :--- |+| **`LifeEventTimeline`** | `AutoTemporalGraph` | **Life Timeline**. Extracts life events with timestamps, sorted chronologically. | Biographies, annals, diaries |+| **`SocialNetwork`** | `AutoGraph` | **Social Network**. Specifically captures interpersonal relationships and interactions. | Character studies, memoirs |+| **`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 |+| **`ConceptEvolution`** | `AutoTemporalGraph` | **Conceptual History**. Tracks how a specific idea or term evolves throughout a text. | History of ideas, evolving concepts |### 2. `finance` (Finance)Optimized for complex financial relationships, market sentiment, and temporal events.diff --git a/hyperextract/templates/README_ZH.md b/hyperextract/templates/README_ZH.mdindex 9f20bf3..e55ba06 100644--- a/hyperextract/templates/README_ZH.md+++ b/hyperextract/templates/README_ZH.md@@ -28,10 +28,37 @@### 1. `general` (General Purpose)适用于无法归类或多领域交叉的文本,通过提取基础实体和SPO关系构建通用图谱。-* **任意文本 (通用提取)**:适用于任何类型的文本(如网页内容、日常笔记、博客文章),直接提取其中的实体及关系,不限制特定领域。++* **任意文本 (通用提取)**:适用于任何类型的文本(如网页内容、日常笔记、博客文章),直接提取其中的实体及关系。+*+| 模板名称 | 底层原语 | 描述 | 典型应用场景 |+| :--- | :--- | :--- | :--- |+| **`KnowledgeGraph`** | `AutoGraph` | **通用知识图谱**。使用通用的 Schema 提取实体与 SPO 关系。 | 任意文本、网页抓取内容 |+| **`EntityRegistry`** | `AutoSet` | **实体注册表**。去重并汇总文本中出现的所有唯一实体(如人名、机构)。 | 实体发现、命名实体识别 |+| **`KeywordList`** | `AutoList` | **关键词列表**。提取文本的核心概念、重要主题或标签。 | 内容打标、索引生成 |+* **维基百科/百度百科条目**:对实体(人物、组织、地点)的综合性描述,包含结构化的属性信息。++| 模板名称 | 底层原语 | 描述 | 典型应用场景 |+| :--- | :--- | :--- | :--- |+| **`EncyclopediaItem`** | `AutoModel` | **百科条目**。针对单一主体提取结构化的属性信息(类似信息框 Infobox)。 | 维基百科、专业词典词条 |+| **`ConceptHierarchy`** | `AutoGraph` | **概念层级图**。构建上下位关系(Subclass-Of)或组成关系(Part-Of)。 | 科学学科、教材知识点 |+| **`CrossReferenceNet`** | `AutoGraph` | **交叉引用网络**。映射概念之间的超链接或相互引用关系。 | 百科内链、跨词条关联图 |+* **人物传记与回忆录**:记录个人生平事迹、主要成就及社会关系的叙事性文本。-* **非虚构类书籍 (大社科/科普)**:跨领域、概念性的书籍(如《人类简史》、《思考,快与慢》),侧重提取通用概念与论点。++| 模板名称 | 底层原语 | 描述 | 典型应用场景 |+| :--- | :--- | :--- | :--- |+| **`LifeEventTimeline`** | `AutoTemporalGraph` | **生平时序图**。提取带时间戳的事件,并按时间顺序排列。 | 人物传记、年表、回忆录 |+| **`SocialNetwork`** | `AutoGraph` | **社交网络图**。专注于提取人际关系、互动与组织隶属。 | 传记分析、人物设定研究 |+| **`PersonalProfile`** | `AutoModel` | **个人档案**。聚合人物的静态属性(生卒年、学历、核心身份)。 | 简历、人物简介、讣告摘要 |++* **非虚构类书籍 (大社科/科普)**:跨领域、概念性的书籍,侧重提取通用概念与论点。++| 模板名称 | 底层原语 | 描述 | 典型应用场景 |+| :--- | :--- | :--- | :--- |+| **`ArgumentMap`** | `AutoHypergraph` | **论点逻辑图**。建模复杂的论证逻辑:多个前提支持一个结论。 | 学术著作、分析性散文 |+| **`ConceptEvolution`** | `AutoTemporalGraph` | **概念演变史**。追踪一个特定概念、词汇随文脉演变的轨迹。 | 思想史书籍、长篇论著 |### 2. `finance` (金融)专注于提取复杂的交易关系、市场观点及时间敏感事件。