CoolFace
Modelpublic

dsmchr/trocr_russian_18th_century_printed

sourceHugging Facecc-by-nc-4.0updated 3mo agoView on Hugging Face
0likes429downloads
Model Card

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

python
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

ParameterValue
Base modelmicrosoft/trocr-base-printed
Epochs3
Batch size8
Maximum training steps4473
Evaluation intervalEvery 200 steps
Best checkpointStep 3600
Best validation CER0.0534