Live data from Hacker News

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

news.ycombinator.com

11–20 of 102 posts

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

#11
post #10

What's RAG?

Retrieval Augmented Generation. It's a way to automatically provide an LLM model with the correct context based on the user's question, providing information directly into the model context, used for information that's not part of the model training.

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

#12
post #10

What's RAG?

from https://en.wikipedia.org/wiki/Retrieval-augmented_generation

"Retrieval augmented generation (RAG) is a type of information retrieval process. It modifies interactions with a large language model (LLM) so that it responds to queries with reference to a specified set of documents, using it in preference to information drawn from its own vast, static training data."

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

#14
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.

There's a lot of valid business cases that rely on parsing PDFs but does not warrant spending $25k on it.

I've helped prototype something using PyMuPDF. It worked as well as it had to, and it didn't cost $25k.

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

#15
post #10

What's RAG?

It's a way of giving LLMs extra information (usually fast changing) that they were no trained with so that you can have them return relevant information. Think of asking an LLM "Who is Paul Graham" (assuming PG is relatively unknown) and it would say it doesn't know. But if you search your own knowledge base and then augment the prompt to something like "Paul Graham is a well known Venture Capitalist. Who is Paul Graham?", it can give you that information back. The idea of adding the extra information is the augmenting and you do that by retrieving relevant information from a knowledge base before you involve the LLM.

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

#16
I've experimented with GCP's Stack using Agent Builder and relying on Gemini Pro 1.5.

I also experimented with pretty large of various files (around 6000 video games full notices) where I used OCR parsing in a similar configuration with mixed results due to the visual complexity of the original content.

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

#17

PyMuPDF seems to be intended for this use-case and mentions images: https://medium.com/@pymupdf/rag-llm-and-pdf-conversion-to-ma... (Though the article linked above has the feeling, to me, of being at least partly AI-written, which does cause me to pause) > Update: We have now published a new package, PyMuPDF4LLM, to easily convert the pages of a PDF to text in Markdown format. Install via pip with `pip install pymup…

So it works for complicated tables et al.?

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

#18
In my experience Azure’s Form Recognizer (now called “Document Intelligence”) is the best (cheapest/most accurate) PDF parser for tabular data.

If I were working on this problem in 2024, I’d use Azure to pre-process all docs into something machine parsable, and then use an LLM to transform/structure the processed content into my specific use-case.

For RAG, I’d treat the problem like traditional search (multiple indices, preprocess content, scoring, etc.).

Make the easy things easy, and the hard things possible.

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

#20

I would recommend give LLMWhisperer a try with the documents pertaining to your use case. https://unstract.com/llmwhisperer/ Try demo in playground: https://pg.llmwhisperer.unstract.com/ Quick tutorial: https://unstract.com/blog/extract-table-from-pdf/

not open source, and OP seems to be the owner.
Post reply on HN