Ask HN: What are you using to parse PDFs for RAG?
71–80 of 102 posts
Re: Ask HN: What are you using to parse PDFs for RAG?
#72Fascinating discussion- but ‘RAG’? Sorry probably obvious but can someone clue me in
Re: Ask HN: What are you using to parse PDFs for RAG?
#73My 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…
Re: Ask HN: What are you using to parse PDFs for RAG?
#74For 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…
Re: Ask HN: What are you using to parse PDFs for RAG?
#75My 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…
Re: Ask HN: What are you using to parse PDFs for RAG?
#76For 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…
Re: Ask HN: What are you using to parse PDFs for RAG?
#77Previously have used https://github.com/pdf2htmlEX/pdf2htmlEX to convert PDF to HTML at scale, could potentially try and parse the output html to markdown as second stage.
Re: Ask HN: What are you using to parse PDFs for RAG?
#78Have you tried https://github.com/VikParuchuri/marker ?
Re: Ask HN: What are you using to parse PDFs for RAG?
#79Have 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.
Re: Ask HN: What are you using to parse PDFs for RAG?
#80https://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/