S6-12 · 基础 S6-12 · Foundation

文档解析 · 别在入库前弄丢结构 Document Parsing · Do Not Lose Structure Before Indexing

PDF / HTML / table → structured, processable content

文档解析(Document Parsing)把 PDF、网页或表格转换为可处理内容,同时尽量保留结构与语义。检索失败常在入库前已经发生,不能只怪检索器或模型。 Document parsing turns PDFs, web pages, and tables into processable content while preserving structure and meaning. Retrieval can fail before indexing begins, so the retriever or model is not always at fault.

01 · 复制出来,不等于读懂版面 01 · Extracted is not understood

表格里的“标准版 30 天”被拉成一串散字后,检索还能把产品和期限配对吗? If “Standard — 30 days” collapses into loose text, can retrieval still pair the product with its return window?

02 解析对照台:同一页,两种结果 Parsing Comparator: One Page, Two Results

解析模式 parse mode
标题保留 Heading kept
100%
H1 → section
表格关系 Table relation
100%
row + column
检索命中 Retrieval hit
Standard → 30d

03 解析要保住的四种信号 Four Signals Parsing Should Preserve

结构 + 语义 structure + meaning
HEADING

标题建立层级 Headings establish hierarchy

“退货政策”应成为段落语境,不是普通一行字。 “Return policy” should become section context, not an ordinary line.

TABLE

表格保存配对 Tables preserve pairings

产品、期限与条件必须维持同一行列关系。 Product, window, and condition must retain their row and column relation.

FOOTNOTE

脚注限定例外 Footnotes qualify exceptions

脚注“拆封不适用”要连接到对应期限,而非漂到页尾。 “Not valid after opening” must stay linked to its window instead of drifting to the page end.

ORDER

阅读顺序保持意义 Reading order preserves meaning

双栏或浮动框不能按坐标误拼成一句话。 Columns and floating boxes must not be stitched into a false sentence by coordinates.

04 最小机制:解析质量先限制可检索证据 Minimal Mechanism: Parsing Quality Bounds Retrievable Evidence

source → blocks → index
retrievable evidence ≤ preserved structure
若“标准版—30 天”关系在解析时丢失,后续分块、索引与检索再强也无法恢复原始配对。 If the “Standard — 30 days” relation is lost during parsing, stronger chunking, indexing, or retrieval cannot reconstruct the original pairing.
识别版面块 Detect layout blocks 标题、表格、脚注 heading, table, footnote
恢复关系 Recover relations 层级、行列、引用 hierarchy, cells, references
输出结构块 Emit structured blocks 交给分块与索引 ready for chunking and indexing

05 边界实验:把表格压成一串文字 Boundary Test: Flatten the Table into a Text Stream

主动制造失败 Create a failure

强制纯文本解析 Force plain-text parsing

产品名、期限和脚注仍有字符,却不再保留行列关系。字符没丢,语义关系已经丢了。 The product, window, and footnote characters remain, but their row and column relations disappear. Text survives while meaning does not.

尚未执行。当前版面关系完整。 Not run yet. Layout relations are intact.
能复制出文字,解析就成功了。 If text can be copied, parsing succeeded. → ✓ 还要保住层级、行列、脚注和顺序。 Hierarchy, cells, footnotes, and reading order must survive too.
检索没命中一定是 embedding 不好。 A retrieval miss always means bad embeddings. → ✓ 证据可能在解析阶段已失去关系。 Evidence may already have lost its relation during parsing.
所有文档都用同一种解析器。 One parser fits every document. → ✓ PDF、网页和表格的结构信号不同。 PDFs, pages, and tables expose different structural signals.
06 · 一句话带走 06 · One line to keep

文档解析不是“把字拿出来”,而是把标题、表格、脚注与阅读顺序转成仍可处理、可检索的结构。 Document parsing is not merely extracting characters; it converts headings, tables, footnotes, and reading order into structure that remains processable and retrievable.