docling-project / docling-project/docling

table column order is inconsistent with bbox.l coordinates

Open
#3,194 4 comments 1 reaction 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
When converting a pdf sometimes table the columns are out of order and the disagree with the tableCell's bbox.l ordering. When column headers are detected, the headers behave differently (not switched)

### Steps to reproduce
process this (https://assets.accessible-digital-documents.com/uploads/2017/01/sample-tables.pdf) pdf and examining markdown output and docling document tableItem for "Table 1", "Table 3", "Table 4"

pipline options:
do_picture_classification=False
do_picture_description=False
enable_remote_services=False
do_table_structure = True
ocr_options = doc_pipe_opts.OcrAutoOptions()
backend = doc_parse_v4.DoclingParseV4DocumentBackend
sample log output:

: #/tables/0: r[1]c[1]bbox.l (385.2) > r[1]c[2]bbox.l (90.0)
: Column header (TH) [90.0] | Column header (TH) [237.6] | Column header (TH) [385.2]
: Data cell (TD) [237.6] | Data cell (TD) [385.2] | Row header (TH) [90.0]
: ---

: #/tables/2: r[0]c[0]bbox.l (307.01826) > r[0]c[1]bbox.l (212.7)
: Daniel Radcliffe [307.01826] | Main character [212.7]
: Rupert Grint [307.02618] | Sidekick 1 [238.8]
: Emma Watson [307.02618] | Sidekick 2 [238.8]
: ---

: #/tables/3: r[1]c[0]bbox.l (307.01826) > r[1]c[1]bbox.l (212.7)
: Role [269.4265] | Actor [307.8532600000001]
: Daniel Radcliffe [307.01826] | Main character [212.7]
: Rupert Grint [307.02618] | Sidekick 1 [238.8]
: ---

### Docling version
Docling version: 2.80.0
Docling Core version: 2.70.1
Docling IBM Models version: 3.12.0
Docling Parse version: 5.4.0

### Python version
Python: cpython-312 (3.12.11)

[5746428c7c3d6225ae6a043ed6f6566ccdd42d59471830ca9428faf2254a4220.doc.json](https://github.com/user-attachments/files/26283610/5746428c7c3d6225ae6a043ed6f6566ccdd42d59471830ca9428faf2254a4220.doc.json)
[5746428c7c3d6225ae6a043ed6f6566ccdd42d59471830ca9428faf2254a4220.md](https://github.com/user-attachments/files/26283611/5746428c7c3d6225ae6a043ed6f6566ccdd42d59471830ca9428faf2254a4220.md)
[sample-tables.pdf](https://github.com/user-attachments/files/26283609/sample-tables.pdf)
[debug_sample-tables.zip](https://github.com/user-attachments/files/26283652/debug_sample-tables.zip)

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.