logoalt Hacker News

Koffiepoeder • today at 7:08 AM • 5 replies • view on HN

For local OCR, after quite some fiddling, for me the best result currently seems to converge on this custom pipeline:

    0) some preprocessing steps (contrast/brightness)
    1) layout detection by paddle [0]
    2) layout detection by granite docling heron [1]
    3) a smart merging algorithm, eg non overlapping surface maximization. Just ask your llm and iterqte a bit.
    4) Custom models for table areas [3] and text nodes [4]
    -
    5) Optional: postprocessing with gemma for structured output
I am now reaching >99% accuracy for invoice and receipt scanning. Even low quality pictures in bad light usually come out fine.

    0: https://www.paddleocr.ai/main/en/version3.x/algorithm/PP-StructureV3/PP-StructureV3.html
    1: https://docling-project.github.io/docling/usage/model_catalog/#stages-and-models-overview
    3: currently mobile, I will complete these later, don't know the exact models by heart
    4:

Replies

barrenko • today at 5:05 PM

Thank you so much for lining this out - as much as I understand it, the OCR is not the problem with LLMs, but a sort of a layout understanding and e.g. "stitching" together tables that are spread across pdf pages.

OpenRouter uses cloudflare as it's api provider for the file parsing for LLMs that may not support files natively, but in some personal benchmarks the mistral's version of the OpenRouter file processing performed better (with GLM 5.3 Flash as the "backend").

ybkshaw • today at 7:13 AM

I'm very interested in what this pipeline looks like - care to share more about this process? I ask because I'm interested in doing document scanning for my family and my small business and ultimately I want to be able to keep an OCR'd, searchable-text archive of anything that comes in, and have an LLM auto categorize and input things like medical expenses into a tax deduction section of my document management app.

➕ show 2 replies
hmokiguess • today at 1:26 PM

Do you have advice for more complex documents like forms or requisitions?

troupo • today at 7:40 AM

Why not just use PaddleOCR? I get excellent results from it.

➕ show 1 reply
qiangull • today at 2:37 PM

[dead]