Using LLama2 to Correct OCR Errors
I've been disappointed by the very poor quality of results that I generally get when trying to run OCR on older scanned documents, especially ones that are typewritten or otherwise have unusual or irregular typography. I recently had the idea of using Llama2 to use common sense reasoning and subject level expertise to correct transcription errors in a "smart" way-- basically doing what a human proofreader who is familiar with the topic might do. I came up with the linked script that takes a PDF as input, runs Tesseract on it to get an initial text extraction, and then feeds this…
Using LLama2 to Correct OCR Errors launched on August 2, 2023 with 54 votes, #1,462 of 4,347 launches that month and more than 90% of that year's launches. The site was still online in September 2026, 3 years on.
In plain words
This tool improves OCR accuracy on older scanned documents by combining Tesseract OCR with Llama2 AI. The script extracts text from PDFs, then uses Llama2 to correct transcription errors and format output as markdown, mimicking a human proofreader's expertise. It's designed for anyone frustrated with poor OCR results on typewritten or irregularly-formatted historical documents. The approach leverages modern Python libraries to make the process practical and accessible.
written from the facts on this page · September 2026
From the sources
Enhances Tesseract OCR output using LLMs (local or API) for error correction, smart chunking, and markdown formatting of scanned PDFs - Dicklesworthstone/llm_aided_ocr
In the maker’s words, at launch
I've been disappointed by the very poor quality of results that I generally get when trying to run OCR on older scanned documents, especially ones that are typewritten or otherwise have unusual or irregular typography. I recently had the idea of using Llama2 to use common sense reasoning and subject level expertise…
Does a similar job
all alternatives →
LLM-aided OCR – Correcting Tesseract OCR errors with LLMs2024 · github.com · ▲479Almost exactly 1 year ago, I submitted something to HN about using Llama2 (which had just come out) to improve the output of Tesseract OCR by correcting obvious OCR errors [0]. That was exciting at the time because OpenAI's API calls were still quite expensive for GPT4, and the cost of running it on a book-length PDF would just be prohibitive. In contrast, you could run Llama2 locally on a machine with just a CPU, and it would be extremely slow, but "free" if you had a spare machine lying around. Well, it's amazing how things have changed since then. Not only have models gotten a lot better,…
Tesseract.js – Pure JavaScript OCR for 60 Languages2016 · github.com · ▲727Pure Javascript OCR for more than 100 Languages 📖🎉🖥 - naptha/tesseract.js
PDF to MD by LLMs – Extract Text/Tables/Image Descriptives by GPT4o2024 · github.com · ▲191I've developed a Python API service that uses GPT-4o for OCR on PDFs. It features parallel processing and batch handling for improved performance. Not only does it convert PDF to markdown, but it also describes the images within the PDF using captions like `[Image: This picture shows 4 people waving]`. In testing with NASA's Apollo 17 flight documents, it successfully converted complex, multi-oriented pages into well-structured Markdown. The project is open-source and available on GitHub. Feedback is welcome.
Qwen-2.5-32B is now the best open source OCR model2025 · github.com · ▲211Last week was big for open source LLMs. We got: - Qwen 2.5 VL (72b and 32b) - Gemma-3 (27b) - DeepSeek-v3-0324 And a couple weeks ago we got the new mistral-ocr model. We updated our OCR benchmark to include the new models. We evaluated 1,000 documents for JSON extraction accuracy. Major takeaways: - Qwen 2.5 VL (72b and 32b) are by far the most impressive. Both landed right around 75% accuracy (equivalent to GPT-4o’s performance). Qwen 72b was only 0.4% above 32b. Within the margin of error. - Both Qwen models passed mistral-ocr (72.2%), which is specifically trained for OCR. - Gemma-3…
BetterOCR combines and corrects multiple OCR engines with an LLM2023 · github.com · ▲63🔍 Better text detection by combining multiple OCR engines (EasyOCR, Tesseract, and Pororo) with 🧠 LLM. - junhoyeo/BetterOCR
LLM Aided Transcription Improvement2024 · github.com · ▲11I recently submitted another project for using LLMs to correct errors and improve formatting of OCRed documents which was well received. The low cost and high quality/speed of the latest "value tier" models from OpenAI and Anthropic have made it possible to get compelling results at a very reasonable price in that application. It occured to me that the same approach taken there (namely, splitting documents into chunks and sending each chunk through a chain of LLM prompts that each take the output of the previous prompt and apply an additional layer of processing) could be easily applied…
More life & fun this month
the category →
A free city-building game in your browser. You are the mayor. You know what the city needs. Now get it past the zoning board, the neighbors, the appeals court and the next election.
Life & fun · 1d ago · permit.petercai.com
- IV
Life & fun · 13d ago · tanzaniaeducationproject.org

Turn a phone, tablet or TV into a sign. Type a message and it fills the screen: welcome signs, timers, Wi-Fi passwords and more. No app, no account, free.
Life & fun · 14d ago · bigwords.page

Play a free virtual guitar online with your keyboard or by touch. Slow songs down and see every chord, string and strum. Acoustic, classic, electric and bass.
Life & fun · 8d ago · guitoro.com

Carrier settings from iPhone, Pixel and Galaxy firmware, decoded and compared: APNs, VoLTE, 5G and Wi-Fi Calling per carrier, and what each build changed.
Life & fun · 12d ago · carrierexplode.com

Life & fun · 22d ago · space.bl2.net
Source: Show HN post ↗ · launch text quoted in part
Launched alongside, August 2023
the whole month →
Resend▲1,325An entire collection of pre-built components with a much faster development experience.
Dev tools · 2023 · resend.com



Lottielab▲869Create and ship lottie animations to sites and apps faster
Dev tools · 2023 · lottielab.com

Outlines is a Python library that focuses on text generation with large language models. Brandon and I are not LLM experts and started the project a few months ago because we wanted to understand better how the generation process works. Our original background is probabilistic, relational and symbolic programming. Recently we came up with a fast way to generate text that matches a regex (https://blog.normalcomputing.ai/posts/2023-07-27-regex-guide...). The basic idea is simple: regular expressions have an equivalent Deterministic-Finite Automaton (DFA) representation. We…
AI · 2023 · github.com