Section of pdf document not parsed via API #218

Open
opened 2026-02-16 00:17:10 -05:00 by yindo · 4 comments
Owner

Originally created by @arnaud0617 on GitHub (Jul 30, 2024).

Originally assigned to: @hexapode on GitHub.

Team

I am using llamaparse API to parse PDF documents.
I was surprised to see some fields or even pages not found in the markdown.

so I was saving two outputs of the same document
a markdown format
a text format

Using the text format, the API works well but the markdown format definitely skips some parts and even page of the document.
When I preview the pdf on your website, the preview works well for both markdown and text but the document extracted via API is definitely missing some content. ( in particular in my example, it skips the table of content

Can you please reproduce the issue ?
you can view my log in my space i get
aledevehat@gmail.com

happy to set up a call to show you the issue

arnaud le devehat
aledevehat@gmail.com
(408) 707-6518 | San Jose, CA

Originally created by @arnaud0617 on GitHub (Jul 30, 2024). Originally assigned to: @hexapode on GitHub. Team I am using llamaparse API to parse PDF documents. I was surprised to see some fields or even pages not found in the markdown. so I was saving two outputs of the same document a markdown format a text format Using the text format, the API works well but the markdown format definitely skips some parts and even page of the document. When I preview the pdf on your website, the preview works well for both markdown and text but the document extracted via API is definitely missing some content. ( in particular in my example, it skips the table of content Can you please reproduce the issue ? you can view my log in my space i get aledevehat@gmail.com happy to set up a call to show you the issue arnaud le devehat aledevehat@gmail.com (408) 707-6518 | San Jose, CA
yindo added the bug label 2026-02-16 00:17:10 -05:00
Author
Owner

@hexapode commented on GitHub (Jul 30, 2024):

Hi!

Could you share a jobid / document so we can have a look?

@hexapode commented on GitHub (Jul 30, 2024): Hi! Could you share a jobid / document so we can have a look?
Author
Owner

@adreichert commented on GitHub (Aug 12, 2024):

I don't know if this is the same issue @arnaud0617 encountered, but we've also observed dropped text. Here is an example we encountered when parsing Instructions for Form I-130, Petition for Alien Relative, and Form I-130A, Supplemental Information for Spouse Beneficiary.

  • We used GPT-4o. It was parsed from the Web UI.
  • We are looking at the Markdown output.
  • As we used a model, text and Markdown output match.

Bullet points 5 and 6 from the top of page 2 are missing:

4. If the beneficiary qualifies under Items 1.C., 1.D., or 1.E. above, you are not required to file separate petitions for the beneficiary’s spouse or unmarried children under 21 years of age. They are considered derivative beneficiaries and you should list them in Part 4 of this petition.

---
[Text should read "5. If you are the lawful permanent resident petitioner..." but this is gone]
# Who May Not File Form I-130?

Job ID: 1127e312-bc21-406b-81f8-660c9a92c77f

@adreichert commented on GitHub (Aug 12, 2024): I don't know if this is the same issue @arnaud0617 encountered, but we've also observed dropped text. Here is an example we encountered when parsing [Instructions for Form I-130, Petition for Alien Relative, and Form I-130A, Supplemental Information for Spouse Beneficiary](https://www.uscis.gov/sites/default/files/document/forms/i-130instr.pdf). * We used GPT-4o. It was parsed from the Web UI. * We are looking at the Markdown output. * As we used a model, text and Markdown output match. Bullet points 5 and 6 from the top of page 2 are missing: ``` 4. If the beneficiary qualifies under Items 1.C., 1.D., or 1.E. above, you are not required to file separate petitions for the beneficiary’s spouse or unmarried children under 21 years of age. They are considered derivative beneficiaries and you should list them in Part 4 of this petition. --- [Text should read "5. If you are the lawful permanent resident petitioner..." but this is gone] # Who May Not File Form I-130? ``` Job ID: 1127e312-bc21-406b-81f8-660c9a92c77f
Author
Owner

@donholly commented on GitHub (Sep 5, 2024):

I am seeing similar results with some of my content. Seems like when text wraps to a 2nd page, a couple things happen:

  • If it's mid-sentence when it wraps to the next page, the rest of that sentence doesn't appear to get parsed on the next page
  • The rest of that paragraph which wrapped from the previous page can be associated with the wrong header in the markdown

I've tried using Accurate parsing and multi-modal (GPT-4o) on the web UI.

Based on what I'm reading, it sounds like maybe the processing is done on a page-by-page basis, so I'm guessing that content which spans more than one page might not be working properly yet?

here are some job ids:

  • e6307e06-be12-46ae-a759-d903ac1e4b21
  • aae9cd5e-3f6d-4ac8-a2f9-1fe32b205926
  • beec6914-50b1-4199-93cd-25c5effc932c

A good example where this seems to happen regularly is from Page 1 to Page 2 and Page 5 to Page 6

Are there any workarounds for this at this point?

I'm currently using Langchain's PDF parsing and it is handling page-to-page content fine - but your Markdown and JSON parsing is far superior for making sense of the content on the page for better RAG :)

Happy to provide more details.

Thanks for your help!

@donholly commented on GitHub (Sep 5, 2024): I am seeing similar results with some of my content. Seems like when text wraps to a 2nd page, a couple things happen: - If it's mid-sentence when it wraps to the next page, the rest of that sentence doesn't appear to get parsed on the next page - The rest of that paragraph which wrapped from the previous page can be associated with the wrong header in the markdown I've tried using Accurate parsing and multi-modal (GPT-4o) on the web UI. Based on what I'm reading, it sounds like maybe the processing is done on a page-by-page basis, so I'm guessing that content which spans more than one page might not be working properly yet? here are some job ids: - `e6307e06-be12-46ae-a759-d903ac1e4b21` - `aae9cd5e-3f6d-4ac8-a2f9-1fe32b205926` - `beec6914-50b1-4199-93cd-25c5effc932c` A good example where this seems to happen regularly is from `Page 1 to Page 2` and `Page 5 to Page 6` Are there any workarounds for this at this point? I'm currently using Langchain's PDF parsing and it is handling page-to-page content fine - but your Markdown and JSON parsing is far superior for making sense of the content on the page for better RAG :) Happy to provide more details. Thanks for your help!
Author
Owner

@katzurik commented on GitHub (Sep 11, 2024):

Moreover, the parsed text from the second page is getting a made-up headers that does not appear in the pdf.

@katzurik commented on GitHub (Sep 11, 2024): Moreover, the parsed text from the second page is getting a made-up headers that does not appear in the pdf.
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#218