Live data from Hacker News

Ask HN: What are you using to parse PDFs for RAG?

news.ycombinator.com

51–60 of 102 posts

Re: Ask HN: What are you using to parse PDFs for RAG?

#51
post #22

We have been using different things for text, images, and tables. I think it's worth pointing out that PDFs are extremely messy under-the-hood so expecting perfect output is a fool's errand; transformers are extremely powerful and can often do surprisingly well even when you've accidentally mashed a set of footnotes into the middle of a paragraph or something. For text, unstructured seems to work quite well and does…

> I think it's worth pointing out that PDFs are extremely messy under-the-hood so expecting perfect output is a fool's errand

This.

A while ago someone asked me why their banking solution doesn't allow to paste payment amounts (among other things) and surely there must be a way to do it correctly.

Not with PDF. What a person reads as a single number may be any grouping of entities which may or may not paste correctly.

Some banks simply don't want to deal with this sort of headache.

Re: Ask HN: What are you using to parse PDFs for RAG?

#52
post #22

We have been using different things for text, images, and tables. I think it's worth pointing out that PDFs are extremely messy under-the-hood so expecting perfect output is a fool's errand; transformers are extremely powerful and can often do surprisingly well even when you've accidentally mashed a set of footnotes into the middle of a paragraph or something. For text, unstructured seems to work quite well and does…

How do you combine the outputs? Wouldn't there be data duplication between unstructured text and tables?

Re: Ask HN: What are you using to parse PDFs for RAG?

#55
For use in retrieval/RAG, an emerging paradigm is to not parse the PDF at all.

By using a multi-modal foundation model, you convert visual representations ("screenshots") of the pdf directly into searchable vector representations.

Paper: Efficient Document Retrieval with Vision Language Models - https://arxiv.org/abs/2407.01449

Vespa.ai blog post https://blog.vespa.ai/retrieval-with-vision-language-models-... (my day job)

Re: Ask HN: What are you using to parse PDFs for RAG?

#56
post #55

For use in retrieval/RAG, an emerging paradigm is to not parse the PDF at all. By using a multi-modal foundation model, you convert visual representations ("screenshots") of the pdf directly into searchable vector representations. Paper: Efficient Document Retrieval with Vision Language Models - https://arxiv.org/abs/2407.01449 Vespa.ai blog post https://blog.vespa.ai/retrieval-with-vision-language-models-... (my day…

I'm sure this will change over time, but I have yet to see an LMM that performs (on average) as well as decent text extraction pipelines.

Text embeddings for text also have much better recall in my tests.

Re: Ask HN: What are you using to parse PDFs for RAG?

#57
Haven’t tried converting it to markdown specifically, but if you want to try a different approach, google’s DocAI has been pretty great. It provides you with the general structure of the document as blocks (paragraph and headers) with coordinates. This makes it so you can send that data to an LLM during the RAG process and get citations of where the answers were found, down to the line of text.

Re: Ask HN: What are you using to parse PDFs for RAG?

#58
You can start to look at pdftotext -layout and pandoc maybe.

Personally I hope a day publishers start learning about the value of data and their representations so they decide to embed them like a *sv file attached to a pdf where the tabular data are immediately available, a .gp and alike file for graphs etc. Essentially the concept of embedding pdf "sources" as an attachment. In LaTeX it's easy to attach the LaTeX itself to the final pdf but so far no one seems to be interested to do so as an habit.

Re: Ask HN: What are you using to parse PDFs for RAG?

#60
post #2

have to pay $25K upfront That's a lot of your money. It's not a big dose of OPM (Other People's Money). When building a business, adequate capitalization solve a lot technical problems and it is no different when a business is built. If you aren't building a business, money is different and there's nothing wrong with not building a business. Good luck.

For me it wouldn't be about the 25k upfront,it is just working with Adobe is incredibly painful, same for Oracle. I really really don't want to work with them in any capacity if i can avoid.

If say MS charged the same or even double that I would still work with them, they at-least they don't treat their customers as criminals.

Post reply on HN