docling-project / docling-project/docling

Layout model produces different SectionHeaderItem vs TextItem classification for same PDF on macOS ARM vs Linux x86_64 (same CPU device, same versions)

Open
#3,329 11 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
2d 21h
Merged PRs (30d)
84

Description

Bug
The same PDF document produces different layout classification results depending on the CPU architecture. On macOS ARM (Apple Silicon), a section heading is correctly classified as SectionHeaderItem with label=section_header. On Linux x86_64 (Google Colab), the exact same block is classified as TextItem with label=text and merged with the preceding paragraph, causing the heading to disappear entirely from the output.
Specifically, the heading ADVERSE REACTIONS: (see also WARNINGS and PRECAUTIONS) from an FDA drug label PDF is correctly detected on macOS ARM but completely missed on Linux x86_64.
macOS ARM output:
[DEBUG ITEM] type=SectionHeaderItem label=section_header level=1
[DEBUG ITEM] text='ADVERSE REACTIONS: (see also WARNINGS and PRECAUTIONS)'
Linux x86_64 output:
[DEBUG ITEM] type=TextItem label=text level=1
[DEBUG ITEM] text='Labor and Delivery: ... Nursing Mothers: ... serious adve'
# ADVERSE REACTIONS heading is completely absent - merged into previous block

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.