datalab-to/surya

OCR, layout analysis, reading order, table recognition in 90+ languages

What it solves

Surya is a high-accuracy, multilingual OCR (Optical Character Recognition) and document intelligence tool. It solves the problem of converting complex documents—including those with tables, equations, and varied layouts—into structured, machine-readable text and HTML, supporting 91 languages.

How it works

Surya uses a 650M parameter Vision Language Model (VLM) to perform layout analysis, text recognition, and table recognition. It can be deployed via an inference manager that automatically spawns a backend server using either vllm for NVIDIA GPUs or llama.cpp for CPU and Apple Silicon. The system can process full pages or specific blocks of text, converting them into HTML (including KaTeX-compatible LaTeX for math) and providing precise bounding boxes for every element.

Who it’s for

It is designed for developers and researchers who need to extract structured data from PDFs, images, and scanned documents, particularly those containing complex formatting like textbooks, tax forms, and corporate documents.

Highlights

  • Multilingual Support: High accuracy across 91 different languages.
  • Document Intelligence: Performs layout analysis (headers, footers, captions) and reading order detection.
  • Table Recognition: Extracts table structures, including rows and columns, and can output full HTML tables.
  • Math Support: Recognizes inline equations and outputs them in KaTeX-compatible LaTeX.
  • Flexible Inference: Supports both GPU (via vllm) and CPU/Apple Silicon (via llama.cpp) backends.

Related

  • Project
  • Project
  • Project
  • Project
  • Project