Downloads · 30 days
35
16% of all-time downloads
Sprakbanken/trocr_smi_synth
trocr_smi_synth is a image-text-to-text model from Sprakbanken. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as cc-by-4.0.
This is a TrOCR-model for OCR (optical character recognition) of Sámi languages. It can be used to recognize text in images of printed text (scanned books, magazines, etc.) in North Sámi, South Sámi, Lule Sámi, and In…
Downloads · 30 days
35
16% of all-time downloads
All-time downloads
221
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 is a TrOCR-model for OCR (optical character recognition) of Sámi languages. It can be used to recognize text in images of printed text (scanned books, magazines, etc.) in North Sámi, South Sámi, Lule Sámi, and Inari Sámi.
This model is a part of our collection of OCR models for Sámi languages.
The following TrOCR models are available:
Sprakbanken/trocr_smi_pred_synth is the model that achieved the best results (of the TrOCR models) on our test dataset.
This model is microsoft/trocr-base-printed trained on Sprakbanken/synthetic_sami_ocr_data for 5 epochs,
and then fine-tuned on manually annotated Sámi OCR data. See our paper for more details.
You can use the raw model for optical character recognition (OCR) on single text-line images in North Sámi, South Sámi, Lule Sámi, and Inari Sámi.
The model only works with images of lines of text. If you have images of entire pages of text, you must segment the text into lines first to benefit from this model.
Use the code below to get started with the model.
from transformers import TrOCRProcessor, VisionEncoderDecoderModel
from PIL import Image
processor = TrOCRProcessor.from_pretrained("Sprakbanken/trocr_smi_synth")
model = VisionEncoderDecoderModel.from_pretrained("Sprakbanken/trocr_smi_synth")
image = Image.open("path_to_image.jpg").convert("RGB")
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]
APA:
Enstad, T., Trosterud, T., Røsok, M. I., Beyer, Y., & Roald, M. (2025). Comparative analysis of optical character recognition methods for Sámi texts from the National Library of Norway. Proceedings of the 25th Nordic Conference on Computational Linguistics (NoDaLiDa).