Downloads · 30 days
44
6% of all-time downloads
dsmchr/trocr_russian_18th_century_printed
trocr_russian_18th_century_printed is a machine learning model from dsmchr. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as cc-by-nc-4.0.
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.
Downloads · 30 days
44
6% of all-time downloads
All-time downloads
725
Public
Parameters
334M
1.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.3 GB · 100%
From the Hugging Face model README
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.
The model is designed for recognizing printed Russian texts with prereform orthography, including historical character forms and typographic features typical of eighteenth-century publications.
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)
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.
| 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 |