Hugging Face 热门模型第 30 名:llamaindex/OCRia-1,110 赞,近期下载 419 次。
标签:transformers, joblib, safetensors, qwen3_5, image-text-to-text, ocr, pdf, markdown, document-parsing, tables, charts, parsebench
README:
OCRia-1
Technical report ·
Blog post ·
Inference blog ·
LlamaParse ·
ParseBench ·
Ollama ·
GGUF
OCRia-1 is a 4B vision-language model for document parsing from LlamaIndex. It reads a page
image and writes the page as Markdown, with tables in HTML, and it is built for the content that document parsers get
wrong most often: merged cells and spanning headers, tables with thousands of cells, charts whose data has to be read
off the plot, and formatting that carries meaning, such as strikethrough, underline, sub- and superscripts and
checkboxes.
- Accuracy: the highest-scoring open-weight model on both ParseBench leaderboards, with
visual grounding included: 85.2 on ParseBench 2 (six dimensions, seventh of 61 systems) and 84.7 on ParseBench 1
(five dimensions, second of 158). It is also first on olmOCR-bench tables and formulas, PulseBench-Tab and
fr-bench-pdf2md. See Benchmarks.
- Tables: nested headers, merged cells as
colspan / rowspan, irregular grids and long financial tables.
- Charts: every chart becomes an HTML table of its data points, with each value under the right series and label
(82.5 on ParseBench 1 charts, against 69.1 for the next-best open-weight model).
- Formatting and math: bold, italic,
strikethrough, underline, highlights, /
``, [ ] / [x] checkboxes, [___] blank fields, and formulas in LaTeX, including handwritten ones.
- Page structure: headers, footers, page numbers and watermarks in their own tags, multi-column text unrolled,
diagrams as Mermaid.
- One call per page: the text comes from the page image alone, with no layout detector, OCR engine or text layer.
Layout boxes are added afterwards.
[!NOTE]
This repository holds the unoptimized BF16 weights. The OCRia-1 that serves
LlamaParse is the same model, quantized and served with a speculative decoder and
custom kernels, which makes it about ten times faster. See Speed and
The Inference Stack Behind OCRia.
OCRia-1 runs inside LlamaParse, which also handles multi-page documents.
Examples
Pages from ParseBench, rendered at 150 DPI and transcribed with greedy decoding. The right-hand image renders what the
model wrote, without editing.
|
Page |
OCRia-1 output |
Dense financial table: a Texas insurance rate filing with a three-level header; the header spans become colspan and the section rows stay in place. |
|
|
| Chart as data: a line chart with three series over five years becomes a table of its 15 data points, matching the printed labels. |
|
|
| Formatting: a hearing notice with struck-through withdrawn cases, underlined case names and bold times; all three are kept. |
|
|
| Handwritten formulas: a handwritten note in Czech; the text is transcribed and each formula written as LaTeX. |
|
|
More examples, including cash-flow statements, bank statements, timetables and economic charts, are in the
blog post.
Quickstart
To run OCRia-1 on your own machine with llama.cpp or Ollama (Linux, Windows, macOS), use the GGUF builds in
llamaindex/OCRia-1-GGUF; the Q8_0 build scores the same as these
weights on a ParseBench 2 sample. On a GPU server:
Serve with vLLM 0.30 or later. vLLM compiles kernels for this architecture at start-up and needs the CUDA toolkit
(nvcc); the vllm/vllm-openai Docker image has it.
vllm serve llamaindex/OCRia-1 --served-model-name ocria-1 --max-model-len 32768 \
--limit-mm-per-prompt '{"image": 1}'
Send each page as one image, with prompt.txt as the system message, no user text, and thinking off.
The Qwen3.5 chat template turns thinking on by default, and with it on the model answers in the wrong format.
import base64
from huggingface_hub import hf_hub_download
from openai import OpenAI
prompt = open(hf_hub_download("llamaindex/OCRia-1", "prompt.txt")).read()
page = base64.b64encode(open("page.png", "rb").read()).decode()
client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
resp = client.chat.completions.create(
model="ocria-1",
messages=[
{"role": "system", "content": prompt},
{"role": "user", "content": [{"type": "image_url", "image_url": {"url": f"data:im
The original belongs to Hugging Face 热门模型 and its authors and is reproduced here for reading. To have it removed, write to support@aisa.one.