This is how you end up with "Xerox scanners/photocopiers randomly alter numbers in scanned documents" https://www.dkriesel.com/en/blog/2013/0802_xerox-workcentres... I dont want hallucinations in places where OCR loses plot. I want either better OCR or error message telling me to repeat the scan.
Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
161–170 of 178 posts
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#162Earlier quoted context omitted.
They're just a new Swift-only interface to the same underlying behaviors, no apparent improvement. I was hoping for more given the visionOS launch but alas What I'm trying now is combining ML Kit v2 with Live Text - Apple's for the accurate paragraphs of text, and then custom indexing that against the ML Kit v2 output to add bounding rects and guessing corrections for missing/misidentified parts from ML Kit (using it…
I feel like text detection is much better covered by the various ML models discussed elsewhere in the comments. Maybe you can combine those with Live Text. I found Tesseract pretty ok for text detection as well but I don’t know if any of the models are good for vertical text.
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#163Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#164Earlier quoted context omitted.
I agree that vision models that actually have access to the image are a more sound approach than using OCR and trying to fix it up. It may be more expensive though, and depending on what you're trying to do it may be good enough. What I want to do is reading handwritten documents from the 18th century, and I feel like the multistep approach hits a hard ceiling there. Transkribus is multistep, but the line detecion mo…
I also think it’s probably more effective. Every time hand-crafted tools are better than AI but then the model becomes bigger and AI wins. Think hand crafted image classification to full model or hand crafted language translation to full model. In this case, the model can already do the OCR and becomes an order of magnitude cheaper per year.
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#165Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#166Earlier quoted context omitted.
Have you tried uploading image of your handwriting to ChatGPT interface with ChatGPT 4o? And what the results were? And if not could you try and let us know what the results are.
Not with 4o, but I tried it with 4 (through Copilot) a while ago and the results were abysmal, even with very neatly printed handwriting.
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#167Earlier quoted context omitted.
> I convert each pdf page to an image and send one request per page to Flash Why convert? Flash 1.5 accepts whole PDFs just fine. It will also increase the models response accuracy. Context: I have found Flash 1.5 is excellent and stable for this kind of use-case. Even at a non-EA price-point it's incredibly cheap, especially when utilizing Batch Prediction Jobs (50% discount!).
> Flash 1.5 accepts whole PDFs just fine. Sometimes models cannot extract the text from the pdf in that case you need to use give the image of the page.
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#168Earlier quoted context omitted.
> I convert each pdf page to an image and send one request per page to Flash Why convert? Flash 1.5 accepts whole PDFs just fine. It will also increase the models response accuracy. Context: I have found Flash 1.5 is excellent and stable for this kind of use-case. Even at a non-EA price-point it's incredibly cheap, especially when utilizing Batch Prediction Jobs (50% discount!).
Curious how you test accuracy across different models, and how much is cost per page?
For the Gemini Flash 1.5 model GCP pricing[0] treats each PDF page an image, so you're looking at pricing per image ($0.00002) + the token count ($0.00001875 / 1k characters) from the base64 string encoding of the entire PDF and the context you provide.
10 page PDF ($0.0002) + ~3,000 tokens of context/base64 ($0.00005625) = $0.00025625
Cut that in half if you utilize Batch Prediction jobs[1] and even at scale you're looking at a rounding error in costs.
For on-going accuracy tracking I take a static proportion of the generations (say 1%, or 10 PDFs for every 1,000) and run them through an evaluation[2] workflow. Depending on how/what you're extracting from the PDFs the eval method is going to change, but I find for "unstructured to structured" use-cases the fulfillment evaluation is a fair test.
0. https://cloud.google.com/vertex-ai/generative-ai/pricing 1. https://cloud.google.com/vertex-ai/generative-ai/docs/model-... 2. https://cloud.google.com/vertex-ai/generative-ai/docs/models...
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#169Earlier quoted context omitted.
> Flash 1.5 accepts whole PDFs just fine. Sometimes models cannot extract the text from the pdf in that case you need to use give the image of the page.
Ah, yes, I've found pre-processing the PDFs to sanitize against things like that has been helpful. That's a whole other process though.
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#170I'm curious if a multimodal model would be better at the OCR step than tesseract? Probably would increase the cost but I wonder if that would be offset by needing less post processing.
My experience is that at least the models which are price-competitive (~= open weight and small enough to run on a 3/4090 - MiniCPM-V, Phi-3-V, Kosmos-2.5) are not as good as Tesseract or EasyOCR. They're often more accurate on plain text where their language knowledge is useful but on symbols, numbers, and weird formatting they're at best even. Sometimes they go completely off the rails when they see a dashed line o…