docling-project / docling-project/docling

For long tables, fields are being truncated

Open
#278 5 comments 0 reactions 1 assignee Claimed by @maxmnemonic View on GitHub
bug table structure
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
2d 21h
Merged PRs (30d)
84

Description

### Bug
In case of tables where most of the columns are empty and one column is completely filled, the table that docling extracts truncates the filled column values.

### Steps to reproduce
I have attached the pdf that has this issue.

Sample PDF:
[doc1.pdf](https://github.com/user-attachments/files/17675990/doc1.pdf)

![image](https://github.com/user-attachments/assets/94217b41-3490-42a9-8f95-10d71ad9ce68)
In this case, for the last column only the value till "accumsan" is getting extracted. I have tested with both `do_ocr=True` and `do_ocr=False`.

```py

from docling.document_converter import DocumentConverter, PdfFormatOption
from docling.datamodel.pipeline_options import PdfPipelineOptions
from docling.datamodel.base_models import InputFormat
source1 = r'pdf_path'
pipeline_options = PdfPipelineOptions()
pipeline_options.do_ocr = False
pipeline_options.table_structure_options.do_cell_matching = True
converter = DocumentConverter(
format_options={
InputFormat.PDF: PdfFormatOption(pipeline_options=pipeline_options)
}
)
result = converter.convert(source1)
doc = result.document
print("Creating Markdown")
with open("output.md", "w", encoding="UTF-8") as f:
f.write(doc.export_to_markdown())
```

### Docling version
Docling version: 2.3.1
Docling Core version: 2.3.1
Docling IBM Models version: 2.0.3
Docling Parse version: 2.0.2

### Python version
Python 3.11.9

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.