docling-project / docling-project/docling

Incorrect Content Ordering in Document Processing

Open
#1,380 1 comment 7 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 processed content is incorrectly ordered in the output.

### Steps to reproduce
When processing documents (at least since version >= 2.23.0), the content is generated in an incorrect and seemingly random order.

Tested with default configuration and the following configuration:
1. `ocr`: Tesseract/EasyOCR
2. `table_mode`: Accurate/Fast
3. `bitmap_area_threshold`: 0.2

For example, when processing the following document [_santander-2023-consolidated-annual-financial-report-en-1-20.pdf](https://github.com/user-attachments/files/19733053/_santander-2023-consolidated-annual-financial-report-en-1-20.pdf):

```
## report
## 2023 Annual

otherwise specified, references in this annual report other documents, including but not limited to other and websites, including our own, are for information only. If the contents of such other documents and refer to this annual report, they are not nor should considered part of it. Unless to reports purposes websites be

the context suggests otherwise, 'Banco Santander' Banco Santander, S.A., and 'Santander', 'the Group' 'Grupo Santander' mean Banco Santander, S.A. and Unless means and subsidiaries.

## directors' report Consolidated
```

And it should be (v2.14):
```
## 2023 Annual report

Unless otherwise specified, references in this annual report to other documents, including but not limited to other reports and websites, including our own, are for information purposes only. If the contents of such other documents and websites refer to this annual report, they are not nor should be considered part of it.

Unless the context suggests otherwise, 'Banco Santander' means Banco Santander, S.A., and 'Santander', 'the Group' and 'Grupo Santander' mean Banco Santander, S.A. and subsidiaries.

## Consolidated directors' report
```

### Docling version
Tested on v2.23, v.25 and v2.28. Working well with Docling v2.14

### Python version
Python 3.11 and 3.12

### Additional information
This issue has been observed both using precompiled `docling-Serve` pre-compiled docker images as using `docling` as a library.

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.