Skip to content

Commit 7bf2caa

Browse files
artizclaude
andcommitted
docs(COMPARING): add PDF backend to the conformance overview
Add a PDF row (3/14 byte-exact vs the committed groundtruth corpus, with a footnote explaining why PDF is scored against the corpus rather than live docling) and a paragraph describing the discriminative PDF pipeline (pdfium + layout/TableFormer/PaddleOCR ONNX stack), what is byte-exact today, and the text-extractor ceiling (pdfium vs docling-parse run boundaries; RTL bidi/ligature). Refresh HTML to 28/33 (corpus grew by a large Wikipedia page). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 744fb41 commit 7bf2caa

1 file changed

Lines changed: 30 additions & 4 deletions

File tree

COMPARING.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,32 @@ case — see the divergence table below.
176176
| **XLSX** | **9 / 9**| 9 / 9 |
177177
| **PPTX** | **7 / 7**| 7 / 7 |
178178
| **DOCX** | **25 / 26** | 25 / 26 |
179-
| **HTML** | **28 / 32** | 29 / 32 |
179+
| **HTML** | **28 / 33** | 28 / 33 |
180+
| **PDF** | **3 / 14**| 4 / 14 |
181+
182+
> † The pure-parse backends above are scored against **live** docling. **PDF** is
183+
> scored against the committed groundtruth corpus (`tests/data/pdf/groundtruth`)
184+
> instead: it is a discriminative ML reconstruction pipeline (not a deterministic
185+
> parse), and the corpus predates docling-core's padded table serializer, so PDF
186+
> output uses the compact `| a | b |` table form.
187+
188+
**PDF** (`*.pdf`) ports docling's *standard* (discriminative) PDF pipeline. pdfium
189+
extracts the text layer (glyph cells + bounding boxes) and renders each page to a
190+
bitmap; an ONNX model stack then interprets it — **layout detection** (the
191+
`heron`/RT-DETR region model), **TableFormer** table-structure recognition (a full
192+
port: image encoder + autoregressive OTSL structure decoder + cell-bbox decoder,
193+
exported to ONNX — see `tableformer.rs`, with cv2-exact `INTER_AREA`/`INTER_LINEAR`
194+
preprocessing in `resample.rs`), and **PaddleOCR** recognition for scanned /
195+
image-only pages — and regions are assembled in reading order into a
196+
`DoclingDocument`. Byte-exact today: `picture_classification`, `code_and_formula`,
197+
and `2305.03393v1-pg9` (**including its TableFormer-reconstructed table, cell for
198+
cell**). The rest are structurally correct but not byte-exact, and the ceiling is
199+
the **text extractor**: pdfium differs from docling's own `docling-parse` C++
200+
parser at text-run boundaries (inter-run spacing such as `LABEL :`, `<td>`, and
201+
fractions) and on right-to-left scripts (bidi reordering + Arabic lam-alef ligature
202+
decomposition) — differences a pdfium-based port cannot close without porting
203+
docling-parse itself. Closest non-exact: `right_to_left_01` (within one line),
204+
`amt_handbook_sample` (~8 lines).
180205

181206
**DOCX** (`*.docx`) is a core port of `MsWordDocumentBackend` (`roxmltree` over
182207
the `ooxml` helper): paragraphs, headings (by style, incl. Title), **numbered
@@ -218,9 +243,10 @@ the drawing parts via the shared `ooxml` zip/rels helper). The one miss
218243
all-empty table.
219244

220245
CSV, Markdown, AsciiDoc, and the DeepSeek-OCR Markdown variant are fully
221-
one-to-one. HTML's 4 remaining misses all require docling-internal subsystems
222-
that depend on **headless-browser rendering** or are otherwise impractical to
223-
port — see below. 28/32 is effectively the ceiling for a pure-parse port.
246+
one-to-one. HTML's 5 remaining misses are a tail of docling-internal behaviours —
247+
some requiring **headless-browser rendering**, others (a large Wikipedia page,
248+
key-value form extraction) needing substantial structural work — see below. 28/33
249+
is roughly the ceiling for a pure-parse port.
224250

225251
**AsciiDoc** (`*.asciidoc`/`*.adoc`) ports docling's line-oriented
226252
`AsciiDocBackend`: titles/sections, nested bullet/numbered lists (all rendered

0 commit comments

Comments
 (0)