Live data from Hacker News

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

news.ycombinator.com

71–80 of 102 posts

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

#72

Fascinating discussion- but ‘RAG’? Sorry probably obvious but can someone clue me in

Retrieval-augmented generation (RAG) is a technique for enhancing the accuracy and reliability of generative AI models with facts fetched from external sources

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

#73

My apps are native Mac apps [0] [1] so naturally I use the native SDK for that. Apple provides PDFKit framework to work with PDFs and it works really well. For scanned documents, I use the Vision framework to OCR the content. Some additional content cleaning is still required but overall I don’t need any other third-party libraries. [0]: https://boltai.com [1]: https://pdfpals.com

Let's apply your app to your home page, easy as 1, 2, 3! 1. Reader mode, copy all text. 2. Prompt ChatGPT 4o: Which headline or sentence structures in the following web page copy suggest a non-native English speaker, and how should each incorrect phrase be fixed for most native-sounding American English? Omit testimonials written by others, just focus on the marketing copy and faq, include reasons for revision. 3. Re…

Thank you. I will improve my landing page following your suggestion. You're right, I'm not a native English speaker

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

#74
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…

You have detractors, but this is the future.

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

#75

My use case is research papers. That means very clear text, combined with graphs of varying form and quality and finally occasional formulas. Two approaches I had most, but not full, success with are: 1) converting to image with pdf2image, then reading with pytesseract 2) throwing whole pdfs into pypdf 3) experimental multimodal models You can get more if you make content more predictable (if you know this part is go…

I have great news I wish someone delivered to me when I was in your shoes - try "GROBID". It parses papers into objects with abstract/body/figures! It will help you out a great deal. It is designed for papers and can extract the text almost flawlessly, but also give information on graphs for separate processing. I have several years experience with academic text processing (including presentations) working with an Academic Publisher if I could be helpful to anything?

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

#76
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…

Is anyone actually having success with this approach? If so, how and with what models (and prompts)?

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

#79

Have you tried https://github.com/VikParuchuri/marker ?

For my use case, overall Marker seems to work pretty well - but it has issues with tables. Merged cells, misplaced headers, and so forth. I'm currently extracting Polish PDFs that are //not// scanned When compared to Azure Document Intelligence, Marker is really cheap when self-hosted (assuming you fall under the license requirements), but it does not produce high quality data. YMMV.

Yeah, the header stuff (and empty cells) for tables needs some work.

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

#80
Open Source Full Featured: https://github.com/Filimoa/open-parse/ [mine]

https://docs.llamaindex.ai/en/stable/api_reference/node_pars... [text splitters lose page metadata]

https://github.com/VikParuchuri/marker [strictly to markdown]

Layout Parsers: These are collections of ML models to parse the core "elements" from a page (heading, paragraph, etc). You'll still need to work on combining these elements into queryable nodes. https://github.com/Layout-Parser/layout-parser

https://github.com/opendatalab/PDF-Extract-Kit

https://github.com/PaddlePaddle/PaddleOCR

Commercial: https://reducto.ai/ [great, expensive]

https://docs.llamaindex.ai/en/stable/llama_cloud/llama_parse... [cheapest, but buggy]

https://cloud.google.com/document-ai https://aws.amazon.com/textract/

Post reply on HN