docling-project / docling-project/docling

Suggestion to fix the reading order issue

Open
#1,558 1 comment 2 reactions 0 assignees View on GitHub
enhancement reading_order triage/close-stale
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

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.