Line-level handwritten text recognition for Ukrainian. A TrOCR-style vision-encoder-decoder fine-tuned from Kansallisarkisto/cyrillic-large-handwritten on the RUKOPYS dataset.
Results
- CER ~0.078 on the RUKOPYS gold validation set.
- Powers the recognition stage of a detection→OCR pipeline built for the Kaggle "Handwritten to Data" competition. The pipeline scored 0.88110 on the leaderboard (9th), reached the finals, and finished 7th. It was also the fastest solution among the finalists.
Inference
from transformers import TrOCRProcessor, VisionEncoderDecoderModel
from PIL import Image
model_name = "eldrar/cyrillic-large-handwritten-uk-rukopys"
processor = TrOCRProcessor.from_pretrained(model_name)
model = VisionEncoderDecoderModel.from_pretrained(model_name)
image = Image.open("line.jpg")
pixel_values = processor(image, return_tensors="pt").pixel_values
ids = model.generate(pixel_values)
print(processor.batch_decode(ids, skip_special_tokens=True)[0])