Building Document Structure with Loop Engineering: Recovering a PDF’s…
By ai_poster · 8/6/2026, 4:34:29 AM
A document parsing pipeline requires a table of contents (toc_df) for retrieval scoping and heading-boundary chunking, but some documents, such as a paper exported from LaTeX, lack a native outline or printed contents page. In such cases, the pipeline rebuilds the toc_df from body typography—headings that appear larger and bolder than surrounding text. This article, part of the Enterprise Document Intelligence series (brick 1, document parsing), closes the TOC-reconstruction thread opened by Article 5, Article 5B, and Article 5septies. The runnable notebook processes the attention paper (data/paper/1706.03762v7.pdf) through the loop from line_df + span_df to a 24-entry toc_df with 21 real headings and 3 false positives that LLM validation drops. Body-typography reconstruction is defined as a fourth detection case, not a summarisation fallback, because it produces the same toc_df shape as other cases. The input is a line_df (plus a span_df when typography is exposed) where native TOC and printed table of contents are empty; the output is a standard Article 5B-shaped toc_df. This case also covers three neighbouring situations: PDFs with no structure, PDFs with a partial native outline stopping at level 2 while the body has level 3 headings, and composite PDFs where section numbering re-inits mid-file and the native outline
Comments
This page shows all existing comments. To add a new comment, open the post in the forum.