OlmOCR
lastmod 2025-03-04created 2025-03-041 edits
An open-source tool for extracting text from PDFs
Features
- An open-source tool that converts PDF and JPG/PNG documents into plain text while preserving natural reading order
- Designed to process large volumes of documents quickly; supports tables, equations, handwriting, and more
- Trained on academic papers, technical documents, and other reference materials
- Uses its own prompting technique to improve accuracy and reduce hallucinations
- The current model is optimized for English documents; other languages are likely not well supported
- Documents can be tested directly on the demo page
- Converting 1 million pages costs about $190 USD, making it economical to run
- Requires a recent NVIDIA GPU (tested on RTX 4090, L40S, A100, H100)
- Try it in the online demo (PDF, JPG, PNG)
Code included in the open-source toolkit
- ChatGPT 4o-based prompting strategy (buildsilver.py): includes techniques that maximize natural text parsing performance
- Pipeline comparison and evaluation tool (runeval.py)
- Language filtering and SEO spam removal (filter.py)
- Fine-tuning code for Qwen2-VL and Molmo-O (train.py)
- Pipeline for processing large numbers of PDFs (pipeline.py): can process millions of PDFs using Sglang
- Dolma document viewer (dolmaviewer.py): visually inspect Dolma-format documents converted from PDFs