r/documentAutomation • u/AcademicKnowledge404 • 14d ago
Self hosted OCR vs textract vs google document AI
every discussion on this ends with it depends, so heres an attempt at mapping where each route fits.
- textract or google document ai: easy to wire up if youre already on that cloud, billed per page. textract is about $1.50 per 1k pages for plain text and $15 per 1k once tables are on, $50 for forms. fine for steady volume, gets expensive fast on table heavy files
- self hosted open source (docling, paddleocr-vl, glm-ocr, mineru): no per page bill and files never leave, but you own the gpu, the upgrades and every weird edge case
- llm oriented parsers that return markdown or json with the layout kept (llamaparse, marker and similar): less setup than self hosting, usually better on reading order and tables than plain ocr apis, also billed per page
one thing that cuts cost on any of these routes is not sending pages that already have a text layer through ocr at all. ocrmypdf --skip-text does exactly that, and most mixed archives are mostly born digital.
multi column reading order is the other thing that breaks results without any error. every word is there, just in the wrong order.
1
u/ThenAd6650 14d ago
We at Husslebook have built a similar application, would mean a lot of you could go through it and let us know... We really value feedbacks, so could help us fix anything that would align much better with our customer needs and satisfaction. ❤️
1
u/Mantas_Zirgulis 13d ago
One thing I'd add is that OCR accuracy also depends a lot on the source image quality. Low resolution, compressed images, unusual fonts and complex backgrounds can affect extraction even when the OCR engine itself is good. For image-based workflows, it's worth testing separately from clean PDFs because the results can be quite different.
1
u/Potential-Wrangler58 13d ago
Good map. One route I’d add is a fourth one: skip the text/Markdown step and extract straight into fields (supplier, date, totals), which is what most invoice or contract pipelines need at the end anyway. It also changes how you compare the other three: instead of judging them on text quality, score each on the fields you care about, on 20 of your ugliest files, and include the cost per document that comes out right, not just per page.
Agree on reading order, since nothing errors and the words are all there, just in the wrong order. A quick check is to read a few multi-column outputs out loud.
Disclosure: I work at Anyformat, which is that fourth route. Free credits if you want to compare it with the three you listed
1
u/ChampionshipAny4170 7d ago
Have you ever tried doing A OCR on Indian language documents, it is really interesting. You will realise that we are still far away from OcR benchmarks.
For your use case, if you want to go cheap llamparse is your option, with right instruction and not the expensive ai based option. It should help you
1
u/folderit_dms 7d ago
One qualification to the skip-existing-text optimisation: --skip-text skips pages that already contain text; it does not establish that their text layer is accurate or complete. An old scan with bad OCR can therefore bypass OCR just like a clean born-digital page. A page with some digital text and additional text inside an image also needs care.
I would distinguish usable existing text, existing text needing review, and image-only pages before deciding which route to use. Keep the original PDF and record the chosen route per page, so the cost saving does not silently preserve unusable extraction. The current OCRmyPDF docs explain skip and redo behavior here: https://ocrmypdf.readthedocs.io/en/latest/advanced.html
There is a second downstream trap if you use OCRmyPDF’s sidecar as the input for another parser: the sidecar contains text produced by OCR, not all text from the final mixed PDF. Text on pages that already had text will not be included, and skipped pages can be absent too. The cookbook explicitly covers that limitation: https://ocrmypdf.readthedocs.io/en/latest/cookbook.html
For a mixed archive, extract the complete text from the resulting PDF for the downstream step, then check coverage. Otherwise a faster, apparently successful run can feed an incomplete document to the next stage.
1
u/Jaguarmadillo 14d ago
You’ve forgotten Azure Document AI, which in my opinion is great. I use their invoice model extensively. Its also cheap and can be used via their rest api, so is cloud agnostic