Files
ragflow/api/db/init_data/compilation_templates/page_index.yaml

70 lines
4.7 KiB
YAML

kind: page_index
display_name: PageIndex — Hierarchical table of contents
config:
kind: page_index
rechunk_rules: |
- Group only adjacent source chunks into coherent semantic units for this page-index task.
- Preserve source order: use every source chunk exactly once; do not omit, overlap, duplicate, or reorder chunks.
- Keep each heading with the content it introduces, and split when the topic, section, or semantic focus changes.
- Preserve document heading hierarchy: keep a parent heading with its introductory content and nearby child-section context.
- Do not combine separate sections merely because their subjects are related; keep each section boundary recoverable.
- Keep self-contained tables, lists, figures, and code blocks intact; do not split their internal rows or items.
- Do not merge unrelated content. Do not invent, rewrite, or return source text; return only chunk grouping metadata.
entity:
description: >-
First extract all actual headings in source order, then extract the
important facts or conclusions under them. Treat explicit chapter markers such as 第N回、
第N章、Chapter N, numbered headings, and Markdown headings as titles
even when they have no `#` marker. A `title` must appear in the source;
copy it exactly and never invent one from a fact or summary. Titles have
priority over facts and conclusions: complete title extraction first and
never replace a title with a fact or conclusion. Do not downgrade an actual
chapter heading to a fact. For other entities, use concise atomic,
source-grounded names and descriptions. Do not invent.
fields:
- type: title
description: the heading text (clean, no page numbers or leader dots)
rule: |
- Identify and emit every explicit heading or chapter marker first, in source order, including 第N回 even without Markdown syntax.
- Copy the clean heading text; do not invent, paraphrase, or promote facts into titles.
- Assign source_chunk_ids yourself: include every source chunk covered by the title's
section, not only the chunk containing the heading. A parent title includes the
chunks of its nested child sections; a child title includes only its own subtree.
Stop at the next title of the same or an ancestor level.
- A line beginning with 第N回/第N章/第N节 or Chapter N is a title when it appears in the source.
- Do not emit the same chapter heading as a fact or conclusion.
- Only after title extraction, emit facts or conclusions under the corresponding titles.
- Summarize the content under each title without copying long passages.
- type: fact
description: a concise source-grounded factual statement belonging to a title
rule: |
- Preserve important dates, numbers, names, units, qualifiers, and values.
- Do not merge unrelated facts into one entity.
- type: conclusion
description: a source-supported finding, outcome, or conclusion belonging to a title
rule: |
- State the conclusion concisely and do not add unsupported interpretation.
relation:
description: >-
You are an expert logical reasoning assistant specializing in document
hierarchy and source-grounded detail attachment. Build relations only
from the entities in the current output. Preserve the title hierarchy
and attach every fact, date, number, named entity, and conclusion to the
nearest relevant title.
fields:
- type: include
description: Upper-level title includes lower-level title.
rule: |
- "-1" is an invalid title; it does not belong to or include any other titles.
- Must follow the hierarchical index/numbering (e.g., "1", "2.1", "3.2.5") when present.
- A title may include a child title or a detail entity.
- Every entity with type `fact` or `conclusion` must have exactly one nearest-title parent.
- Detail entities must not be attached directly to another detail entity.
- Do not create relations between unrelated detail entities.
- Every `from` and `to` value must exactly match an entity `name` in the current output.
- Never use a source heading as an endpoint unless that heading was also emitted as a `title` entity.
- Before returning, remove any relation whose endpoint is missing and verify that every detail entity has one parent relation.
- Keep language of "title" the same as the input.
- 第N回、 第N章 must include their actual child sections or detail entities when present.
global_rules: ''