Description
Both docling-layout-heron and docling-layout-heron-101 misclassify PDF forms with grid lines as Table instead of Form, even though both models have Form (label 15) and Key-Value Region (label 16) in their id2label config.
When the layout model classifies a form region as Table, TableFormer then attempts to reconstruct it as a data table, producing severely garbled output with content duplicated across 7-8 identical columns.
Reproduction
Input: Any PDF form with visible grid lines containing key-value pairs (e.g., an order form with fields like Customer, Date, Account Name, Address, etc. laid out in a bordered grid).
Docling version: 2.82.0
Layout models tested: docling-layout-heron, docling-layout-heron-101
Pipeline: StandardPdfPipeline with TableFormerMode.ACCURATE
from docling.document_converter import DocumentConverter
result = DocumentConverter().convert("order_form.pdf")
print(result.document.export_to_markdown())
Expected: The form region should be classified as Form or Key-Value Region, and the output should preserve key-value pairs:
Date: 16/03/2026
Account Name: Scope Furnishing Ltd
Local Address: Lowlands Industrial Estate, ...
Actual: The form is classified as Table, and TableFormer produces output like:
| Customer | Customer | Customer | Customer | Customer | Customer | Customer |
|---|---|---|---|---|---|---|
| Date 16/03/2026 | Date 16/03/2026 | Date 16/03/2026 | Date 16/03/2026 | ...
Every row's content is duplicated across all columns.
Analysis
- The
Form label (15) and Key-Value Region label (16) exist in both Heron and Heron-101 config.json
- Neither model fires these labels on grid-lined forms — the grid lines cause the model to predict
Table instead
- Disabling
do_table_structure=False doesn't help — the region is still classified as Table and dumped into a single cell
- The embedded text layer is correct (all content is present), only the structural classification is wrong
Impact
Forms with grid lines are extremely common in business documents (order forms, application forms, invoices with header sections). This misclassification makes Docling unusable for these documents without manual intervention or VLM fallback.
Environment
- Docling 2.82.0
- GPU: NVIDIA Blackwell RTX PRO 6000
- OS: Ubuntu (Debian-based)
- Python 3.12
Description
Both
docling-layout-heronanddocling-layout-heron-101misclassify PDF forms with grid lines asTableinstead ofForm, even though both models haveForm(label 15) andKey-Value Region(label 16) in theirid2labelconfig.When the layout model classifies a form region as
Table, TableFormer then attempts to reconstruct it as a data table, producing severely garbled output with content duplicated across 7-8 identical columns.Reproduction
Input: Any PDF form with visible grid lines containing key-value pairs (e.g., an order form with fields like Customer, Date, Account Name, Address, etc. laid out in a bordered grid).
Docling version: 2.82.0
Layout models tested:
docling-layout-heron,docling-layout-heron-101Pipeline:
StandardPdfPipelinewithTableFormerMode.ACCURATEExpected: The form region should be classified as
FormorKey-Value Region, and the output should preserve key-value pairs:Actual: The form is classified as
Table, and TableFormer produces output like:Every row's content is duplicated across all columns.
Analysis
Formlabel (15) andKey-Value Regionlabel (16) exist in both Heron and Heron-101 config.jsonTableinsteaddo_table_structure=Falsedoesn't help — the region is still classified as Table and dumped into a single cellImpact
Forms with grid lines are extremely common in business documents (order forms, application forms, invoices with header sections). This misclassification makes Docling unusable for these documents without manual intervention or VLM fallback.
Environment