Escriba-OCR-1B: Handwritten text recognition preserving errors
2 min readupdated
The model specializes in digitizing handwritten student essays in Brazilian Portuguese. Unlike universal OCR systems and VLMs, it does not correct the author's errors, instead transcribing them accurately line by line. Built on the LightOnOCR-3-1B architecture (combining a Pixtral encoder and a Qwen3 decoder), it contains about 1 billion parameters. Trained on the BRESSAY dataset, it preserves strikethroughs, corrections, and hyphenated line breaks using special markup. The model is useful for educators, researchers, and developers of educational tools analyzing real student work.
Key features
- Handwriting specialization: Accurately decodes essay handwriting while preserving students' original spelling.
- Preservation of edits: Transmits crossed-out words and superscript or subscript insertions using BRESSAY markup.
- Compact size: Around 1 billion parameters allow running the model on both GPU and standard CPU via GGUF format.
- High accuracy: Outperforms many large open models on the specialized dataset thanks to dedicated fine-tuning.
What you can do
- Archive digitalization: Turn paper student papers into text for automated text corpus collection.
- Linguistic research: Analyze the development of written language and typical student spelling errors.
- Software integration: Use the model in local document processing pipelines using vLLM or llama.cpp.
Example
# pip install "vllm>=0.34" pillow
import base64, io
from PIL import Image
from vllm import LLM, SamplingParams
def to_data_url(path, long_side=1200):
im = Image.open(path).convert("RGB")
f = long_side / max(im.size)
im = im.resize((round(im.width * f), round(im.height * f)), Image.LANCZOS)
buf = io.BytesIO(); im.save(buf, format="PNG")
return "data:image/png;base64," + base64.b64encode(buf.getvalue()).decode()
llm = LLM(model="tardellirs/Escriba-OCR-1B", max_model_len=8192, limit_mm_per_prompt={"image": 1})
params = SamplingParams(temperature=0.0, repetition_penalty=1.05, max_tokens=2048)
messages = [{"role": "user", "content": [{"type": "image_url", "image_url": {"url": to_data_url("redacao.jpg")}}]}]
print(llm.chat([messages], params)[0].outputs[0].text)
Read more
DetailsBenchmarks: CER (character error rate) is 2.06% on the BRESSAY test split, WER is 5.9%.
Hardware requirements: Efficient execution via vLLM on GPU or via llama.cpp on CPU (about 3.5 GB RAM for Q4_K_M quantization).
Limitations: CC BY-NC 4.0 license (non-commercial use only, inherited from training data).
Details: The model is not intended for evaluating essays, printed documents, or languages other than Portuguese.










Comments