docling-project / docling-project/docling

Doesn't parse the table, treats it as an image

Open
#590 6 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
3d 4h
Merged PRs (30d)
95

Description

Thank you guys for your work.
While using it I found out that docling can save tables as images by doing the following
```python
for element, _level in conv_res.document.iterate_items()::
if isinstance(element, TableItem).
table_counter += 1
element_image_filename = (
output_dir / “tables” / f “table-{table_counter}.png”
)
element_image_filename.parent.mkdir(parents=True, exist_ok=True)
with element_image_filename.open(“wb”) as fp.
element.get_image(conv_res.document).save(fp, “PNG”)
```
In my task, due to the complexity of tables, many of which are not recognized correctly, I wanted it to be treated as an image without parsing, so I set up the
```python
pipeline_options.do_ocr = False
pipeline_options.do_table_structure = False
```
But this causes the table not to be inserted into the resulting markdown, but the table is still recognized. So I think the table recognition can be inserted as an image into the original text position, now is there a way to achieve this task? Or give me a little idea for modification, thanks!

Contributor guide

Open the contributing guide

Research direction

Start from the supplied Python conversion loop and the pipeline_options.do_ocr and do_table_structure settings, then trace how recognized tables are emitted into Markdown. Check how the resulting document represents the table's original position and verify that disabling table parsing preserves it as an image in the output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.