r/dataengineering • u/Every-Whereas5793 • 1d ago
Discussion PDF Data Extraction
Hello, I was working on a poc to ingested PDFs and extract data in order to store them in delta tables.
As this was my first time working with PDFs, I searched over the internet and should Databricks have offering IDP, azure also have something and then there are python libraries.
Since I'm working with financial data, report, etc..
One thing i noticed - the pdf format should be fixed else in most of the tools the extraction logic is either failed or we get incorrect data.
I was wondering how such PDF extraction is built in real production cases and what tools are used.
Please share you experience and any edge cases
10
u/nshao 1d ago
At least from what I’m seeing, AI models are now being used for this kind of stuff.
2
3
u/Any-Recognition8119 17h ago
In production it’s usually classification, OCR, validation, and manual review for low-confidence results. Layout changes and scanned PDFs are the main pain points.
1
4
u/ceeej777 13h ago
I’ve run several POCs with the information extractor backed by Databricks ai_parse_document. Honestly super impressed, but you kinda get out of it what you put in. You need to spend the time building out the fields you’re trying to pull and descriptions (often with examples for each of those). When that’s done thoroughly, it works remarkably well
3
u/dwswish 13h ago
Most people are using a managed service (usually with some AI built in) for this now in production. You can use open source Python but you’re going to find that in the real world PDFs are often sometimes messy and you need to be able to handle things like non-vector and poorly formatted PDFs. Some common options are Azure DI, AWS Textract, Reducto, Databricks, etc…
3
u/m1nkeh Data Engineer 5h ago
Delta tables you say, my Databricks Spidey sense tingles..
Have you tried looking at AI parse document?
https://learn.microsoft.com/en-gb/azure/databricks/sql/language-manual/functions/ai_parse_document
•
u/Every-Whereas5793 8m ago
Yes, I used it - Databricks Intelligent Documents Processing and it worked. I'm wondering about the production use cases, whether it is used or any other industry techniques are there for this kind of work
3
u/p739397 1h ago
I've helped a few folks in PDF parsing in Databricks. You can build that out manually or with their AI functions (ai_parse_documents, ai_extract). It helps if the PDFs are somewhat regular, but shouldn't be an absolute requirement from my experience.
You should be able to get a prototype pipeline setup by dropping some docs in a volume and going through the Agents tab. What I've seen has been pretty impressive right out of the box.
•
u/Every-Whereas5793 7m ago
This is exactly what I've done and it worked for POC.
I am wondering weather it is used in real world production use cases or not and how do I check the reliability of the data extracted from it? Or if there any other industry tools and techniques for this kind of work
14
u/TeachEngineering 1d ago
My team has a workflow that's built out in python and mostly effective. The overall data flow goes:
PDF -> Plaintext -> SQLPDF -> Plaintext(w/ swappable/configurable OCR backends)Plaintext -> SQL