docling-project / docling-project/docling-parse

Layout parsing does not populate children parameter- missing hierarchical document structure

Open
#130 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
333
Forks
80
Avg merge
1d 14h
Merged PRs (30d)
10

Description

Problem
Docling successfully detects and labels section headers ("label": "section_header") but fails to establish proper parent-child relationships between headers and their content. All text elements remain as direct children of the document body instead of being organized under their respective section headers.

Current Behavior
`{
"label": "section_header",
"text": "Linux Kernel Development",
"level": 1,
"children": [] // Always empty
}`

Text elements that logically belong under this header are not referenced in the children array, resulting in a flat document structure where all elements are direct children of body.

Expected Behavior
Section headers should have their children array populated with references to text elements that belong to that section:
`{
"label": "section_header",
"text": "Linux Kernel Development",
"level": 1,
"children": [
{"$ref": "#/texts/3"},
{"$ref": "#/texts/4"},
// ... other content under this section
]
}`

code
```C
from docling.document_converter import DocumentConverter, PdfFormatOption
from docling.datamodel.pipeline_options import PdfPipelineOptions

pipeline_options = PdfPipelineOptions()
pipeline_options.do_code_enrichment = True
pipeline_options.do_formula_enrichment = True

converter = DocumentConverter(format_options={
InputFormat.PDF: PdfFormatOption(pipeline_options=pipeline_options)
})
```

# Questions

- Are there specific pipeline options to enable hierarchical layout parsing?
- Is there a way to configure the layout model to better understand section boundaries?
- Should do_table_structure or other options be enabled to improve hierarchy detection?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.