Downloads · 30 days
258
8% of all-time downloads
Kansallisarkisto/cyrillic-htr-model
cyrillic-htr-model is a image-to-text model from Kansallisarkisto. Use it when you need a caption or text from an image. The card lists the license as apache-2.0.
Downloads · 30 days
258
8% of all-time downloads
All-time downloads
3.4K
Public
Repo size
4.5 GB
Likes
5
Public
Click a slice to open those files.
.bin2.2 GB · 100%
From the Hugging Face model README
Model Name: cyrillic-htr-model
Model Type: Transformer-based OCR (TrOCR)
Base Model: microsoft/trocr-large-handwritten
Purpose: Handwritten text recognition
Languages: Cyrillic
License: Apache 2.0
This model is a fine-tuned version of the microsoft/trocr-large-handwritten model, specialized for recognizing handwritten cyrillic text. At the moment it has been trained on the dataset (number of pages 740) from 17th to 20th centuries.
The model is based on a Transformer architecture (TrOCR) with an encoder-decoder setup:
This model is designed for handwritten text recognition and is intended for use in:
The training dataset includes more than 30000 samples of handwritten text rows.
The model was evaluated on test dataset. Below are key metrics:
Character Error Rate (CER): 8
Test Dataset Description: size ~33 400 text rows
You can use the model directly with Hugging Face’s pipeline function or by manually loading the processor and model.
from transformers import TrOCRProcessor, VisionEncoderDecoderModel
from PIL import Image
# Load the model and processor
processor = TrOCRProcessor.from_pretrained("Kansallisarkisto/cyrillic-htr-model/processor")
model = VisionEncoderDecoderModel.from_pretrained("Kansallisarkisto/cyrillic-htr-model")
# Open an image of handwritten text
image = Image.open("path_to_image.png")
# Preprocess and predict
pixel_values = processor(image, return_tensors="pt").pixel_values
generated_ids = model.generate(pixel_values)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(generated_text)
The model was trained primarily on handwritten text that uses basic Cyrillic characters.
Potential improvements for this model include:
If you use this model in your work, please cite it as:
@misc{cyrillic_htr_model_2025,
author = {Kansallisarkisto},
title = {Cyrillic HTR Model: Handwritten Text Recognition},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Kansallisarkisto/cyrillic-htr-model/}},
}
Author: Kansallisarkisto