Stacked table headers seen as separate headers #65

Open
opened 2026-02-16 00:16:46 -05:00 by yindo · 1 comment
Owner

Originally created by @dcellison on GitHub (Mar 26, 2024).

Tables in a PDF document with headers that appear as two words stacked on top of each other are parsed as separate headers. In the image below, "senior leadership" is the column header.

table-example

As well, the parser sees the table's title as part of the table itself, so the table ends up being only two columns wide. The resulting markdown from LlamaParse appears like this:

| |2022 Gender Representation by Level (global)1|
|---|---|
| |SENIOR|MIDDLE|LEADERSHIP|MANAGEMENT|PROFESSIONALS|TOTAL|
|Female|39.0%|51.3%|36.0%|44.0%|
|Male|61.0%|48.7%|64.0%|56.0%|

Two different Markdown renderers give this as a result:

rendered

With manual repairs, the Markdown renders like this:

repaired

Any help with this would be appreciated!

Originally created by @dcellison on GitHub (Mar 26, 2024). Tables in a PDF document with headers that appear as two words stacked on top of each other are parsed as separate headers. In the image below, "senior leadership" is the column header. <img width="602" alt="table-example" src="https://github.com/run-llama/llama_parse/assets/134390741/09e852cb-8ead-4b3b-a5c1-fbf753be405d"> As well, the parser sees the table's title as part of the table itself, so the table ends up being only two columns wide. The resulting markdown from LlamaParse appears like this: ```md | |2022 Gender Representation by Level (global)1| |---|---| | |SENIOR|MIDDLE|LEADERSHIP|MANAGEMENT|PROFESSIONALS|TOTAL| |Female|39.0%|51.3%|36.0%|44.0%| |Male|61.0%|48.7%|64.0%|56.0%| ``` Two different Markdown renderers give this as a result: <img width="483" alt="rendered" src="https://github.com/run-llama/llama_parse/assets/134390741/5183806b-8e26-4c93-bbad-021c0db11181"> With manual repairs, the Markdown renders like this: <img width="728" alt="repaired" src="https://github.com/run-llama/llama_parse/assets/134390741/ebd28bde-5486-4f9c-8049-d11aba49fc55"> Any help with this would be appreciated!
yindo added the bug label 2026-02-16 00:16:46 -05:00
Author
Owner

@dcellison commented on GitHub (Mar 26, 2024):

Here is the PDF in question. It's a single page extracted from the 2022 Coca-Cola business and sustainability report. I've been using it to test various PDF parsing tools. It typifies what I encounter when processing PDFs for embedding.

@dcellison commented on GitHub (Mar 26, 2024): Here is the [PDF](https://github.com/run-llama/llama_parse/files/14757570/coke-one-page.pdf) in question. It's a single page extracted from the 2022 Coca-Cola business and sustainability report. I've been using it to test various PDF parsing tools. It typifies what I encounter when processing PDFs for embedding.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_cloud_services#65