datalab-to/chandra-ocr-2 · Hugging Face

Open the original

Short summary

Chandra OCR 2 is Datalab's optical character recognition model that converts documents to markdown, HTML, or JSON while preserving layout. It scores 85.8% on the olmOCR benchmark and supports 90+ languages with strong performance on tables, math, handwriting, and complex layouts.

  • Chandra 2 achieves 85.8% on olmOCR benchmark (state-of-art), a 12% improvement over Chandra 1's 77.8% multilingual score, with particular strength in math, tables, and complex layouts
  • Available through multiple deployment methods: HuggingFace Transformers, vLLM, SGLang, and Docker, with quickstart CLI tools for local use
  • Handles 90+ languages, extracts images with captions, reconstructs forms accurately including checkboxes, and supports handwriting recognition across diverse document types

Full summary

Chandra OCR 2 is a document recognition model from Datalab that extracts text from images and PDFs while preserving layout information. It outputs results in markdown, HTML, or JSON formats and supports over 90 languages. The model scores 85.8% on the olmOCR benchmark—currently the highest score in that category—with particular strength in handling math, tables, complex layouts, and handwriting. It's a 12% improvement over the original Chandra 1 model. The tool works through multiple deployment paths depending on your setup. You can use it directly through HuggingFace Transformers with a simple pip install, or run it via vLLM or SGLang for better performance. There's also a command-line interface for quick document processing. The code examples show straightforward integration—load the model, pass in an image or PDF, and get structured output back. A hosted API and free playground are available if you don't want to run it locally. Benchmarks reveal where Chandra 2 excels and where it falls short. It dominates on ArXiv papers (86.9%), old scans (89.1%), and tables (92.1%), but struggles more with math formulas in old scans (51.1%) and headers/footers. It outperforms most open-source competitors like olmOCR and dots.ocr, though Datalab's own hosted API scores slightly higher at 86.7%. The model handles real-world scenarios well—the examples show it can extract from statistical tables, financial documents, handwritten forms, and multilingual text.

Ask about this article