RadarTopicsBuildersWeeklyReads
Open Source Radar
Dicklesworthstone/

llm_aided_ocr

GitHub

LLM-Aided OCR project that uses OCR output from Tesseract, then applies LLM-based corrections and optional Markdown formatting. It supports local or API-based LLMs, chunking, asynchronous processing, and detailed logging. The repo provides installation steps and usage guidance via a Python script.

3.0kstars
211forks
0issues
2023since
Star historydaily snapshots by VibeCrowd

Collecting history — the radar snapshots this repo daily. The trend line appears after 3 days of data (1 so far).

Alternatives & relatedmatched by topic overlap
Reviewgenerated from repository data · Aug 5, 2026

What it is

The LLM-Aided OCR Project enhances OCR outputs by applying LLM-based error correction and optional Markdown formatting to OCR text derived from PDFs via Tesseract. It supports both local LLMs and cloud-based API providers, with asynchronous processing for improved performance and detailed logging.

How it works

  • PDF to image conversion using pdf2image
  • OCR using Tesseract (pytesseract) with preprocessing steps
  • Splits raw OCR into chunks for processing with overlap to preserve context
  • For each chunk, uses an LLM to correct OCR errors and optionally format as Markdown
  • Removes duplicate content during Markdown formatting
  • Optional suppression of headers, footers, and page numbers
  • LLM integration supports local LLMs (llama_cpp) and API providers (OpenAI, Anthropic), with error handling and token management
  • Asynchronous processing via asyncio when using API-based LLMs to process chunks concurrently while preserving order
  • Quality assessment comparing original OCR to processed output
  • Logging throughout the process

Getting started

  • Prerequisites include Python 3.12+, Tesseract OCR, pdf2image, PyTesseract, and optionally OpenAI/Anthropic APIs or a local LLM
  • Installation sequence:
    1. Install Pyenv and Python 3.12 (provided script)
    2. Set up the project:
      git clone https://github.com/Dicklesworthstone/llm_aided_ocr    
      cd llm_aided_ocr          
      pyenv local 3.12
      python -m venv venv
      source venv/bin/activate
      python -m pip install --upgrade pip
      python -m pip install wheel
      python -m pip install --upgrade setuptools wheel
      pip install -r requirements.txt
      
    3. Install Tesseract OCR (system package dependent)
    4. Create a .env with API keys and settings, e.g.
      USE_LOCAL_LLM=False
      API_PROVIDER=OPENAI
      OPENAI_API_KEY=your_openai_api_key
      ANTHROPIC_API_KEY=your_anthropic_api_key
      
  • Usage:
    1. Place your PDF in the project directory
    2. Update input_pdf_file_path in main()
    3. Run the script:
      python llm_aided_ocr.py
      
  • Outputs include raw OCR output and final LLM-corrected Markdown or text files

Recent releases

  • No releases listed in the latest entry

Traction

  • Stars: 2972

Behind the repo

  • Repository owner: Dicklesworthstone
  • Language: Python
  • License: none listed

Caveats

  • License not listed in the repository data
  • Requires external dependencies (Tesseract, pdf2image, OpenAI/Anthropic or local LLMs) and environment configuration
  • Age: Created 2023-07-26; last push 2026-08-03
SharePost on XLinkedIn
All trending reposRevenue-verified startups →