TrOCR Base for 18th-Century Russian Printed Texts

This model is a fine-tuned version of microsoft/trocr-base-printed for optical character recognition (OCR) of historical Russian printed texts from the eighteenth century.

Intended Use

The model is designed for recognizing printed Russian texts with prereform orthography, including historical character forms and typographic features typical of eighteenth-century publications.

Base-usage

from PIL import Image
from transformers import TrOCRProcessor, VisionEncoderDecoderModel

hf_model = VisionEncoderDecoderModel.from_pretrained("dsmchr/trocr_russian_18th_century_printed")

image = Image.open("./path/to/your/image")

processor = TrOCRProcessor.from_pretrained("microsoft/trocr-base-printed")
pixel_values = processor(images=image, return_tensors="pt").pixel_values

generated_ids = hf_model.generate(pixel_values)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(generated_text)

Training Dataset

The model was fine-tuned on a custom OCR dataset containing 14,911 manually aligned text lines.

The dataset was compiled from Russian printed books of various genres and printing houses, predominantly published during the second half of the eighteenth century. Ground-truth transcriptions preserve the original historical spelling.

Training Details

Parameter Value
Base model microsoft/trocr-base-printed
Epochs 3
Batch size 8
Maximum training steps 4473
Evaluation interval Every 200 steps
Best checkpoint Step 3600
Best validation CER 0.0534
Downloads last month
-
Safetensors
Model size
0.3B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support