docling-project / docling-project/docling
Suggestion to fix the reading order issue
- Dominant language
- Python
- Stars
- 66.4k
- Forks
- 4.8k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 98
Description
### Problem
I found that the reading order is incorrect in some of our documents due to overlapping bounding boxes. In the [ReadingOrderPredictor model](https://github.com/docling-project/docling-ibm-models/blob/f438c60fd8bc87b4330fc73f790aa5706728e968/docling_ibm_models/reading_order/reading_order_rb.py#L335) ements are incorrectly positioned relative to each other before the DFS can run, resulting in a messed-up reading order. In my case, increasing the **eps** parameter (e.g., setting eps=1) solved the problem.
### Requested feature
Make the eps parameter configurable or find a better default value that works for pdf files with overlapping bounding boxes.
### Example document
[Magyar_regeszet_az_ezredfordulon_97_101.pdf](https://github.com/user-attachments/files/20118968/Magyar_regeszet_az_ezredfordulon_97_101.pdf)
Contributor guide
Assessment
This issue has not been assessed yet.