Bug
A poetic line with dot leaders (................ жизни картиновой ................ понесло Константиново ».) is misclassified as formula by the layout model (OCR text with ellipsis, not a math formula).
The block is exported as FormulaItem with OCR text in orig, but text is empty / missing. Parse returns success, yet json_content fails DoclingDocument.model_validate_json(). Chunking then fails: Input document parsed.json is not valid.
Setting text from orig fixes validation and chunking.
Root cause (as seen downstream): classification error → invalid schema export.
Steps to reproduce
- Parse attached 1-page PDF (misprocessed.pdf, poetic excerpt with dot leaders)
- In
json_content, find item with "label": "formula" and dotted Russian text in orig, no text.
- Validate: ```python
from docling_core.types.doc import DoclingDocument
DoclingDocument.model_validate_json(open("parsed.json", "rb").read())
→ fails (`text` required on formula item).
- Chunk same JSON via
/v1/chunk/hybrid/source/async (from_formats: ["json_docling"]) → 0 chunks.
- Add
"text": "<same as orig>" → validation and chunking succeed.
Parsing options used:
{
"do_ocr": false,
"do_formula_enrichment": false,
"do_code_enrichment": false,
"to_formats": ["json", "text"]
}
Minimal fragment:
{
"self_ref": "#/texts/5",
"parent": {
"$ref": "#/body"
},
"content_layer": "body",
"label": "formula",
"prov": [omitted],
"orig": "..................... жизни картиновой ..................... понесло Константиново »."
},
{
"self_ref": "#/texts/6",
"parent": {
"$ref": "#/body"
},
"content_layer": "body",
"label": "text",
"prov": [omitted],
"orig": "(Восп., 2, 131)",
"text": "(Восп., 2, 131)"
},
Expected: classify as text/paragraph; if labeled formula, populate text (e.g. from orig) so export passes schema validation.
Docling and Python versions
docling-serve output:
Docling version: 2.107.0
Docling Core version: 2.85.0
Docling IBM Models version: 3.13.3
Docling Parse version: 7.2.0
Python: cpython-312 (3.12.13)
Platform: Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.34
Attachments: 1-page PDF + JSON fragment above.
Bug
A poetic line with dot leaders (
................ жизни картиновой ................ понесло Константиново ».) is misclassified asformulaby the layout model (OCR text with ellipsis, not a math formula).The block is exported as
FormulaItemwith OCR text inorig, buttextis empty / missing. Parse returns success, yetjson_contentfailsDoclingDocument.model_validate_json(). Chunking then fails:Input document parsed.json is not valid.Setting
textfromorigfixes validation and chunking.Root cause (as seen downstream): classification error → invalid schema export.
Steps to reproduce
json_content, find item with"label": "formula"and dotted Russian text inorig, notext.from docling_core.types.doc import DoclingDocument
DoclingDocument.model_validate_json(open("parsed.json", "rb").read())
/v1/chunk/hybrid/source/async(from_formats: ["json_docling"]) → 0 chunks."text": "<same as orig>"→ validation and chunking succeed.Parsing options used:
Minimal fragment:
{ "self_ref": "#/texts/5", "parent": { "$ref": "#/body" }, "content_layer": "body", "label": "formula", "prov": [omitted], "orig": "..................... жизни картиновой ..................... понесло Константиново »." }, { "self_ref": "#/texts/6", "parent": { "$ref": "#/body" }, "content_layer": "body", "label": "text", "prov": [omitted], "orig": "(Восп., 2, 131)", "text": "(Восп., 2, 131)" },Expected: classify as text/paragraph; if labeled
formula, populatetext(e.g. fromorig) so export passes schema validation.Docling and Python versions
docling-serveoutput:Attachments: 1-page PDF + JSON fragment above.