Comparative analysis of optical character recognition methods for Sámi texts from the National Library of Norway (2025)

Abstract: Optical Character Recognition (OCR) is crucial to the National Library of Norway’s (NLN) digitisation process as it converts scanned documents into machine-readable text. However, for the Sámi documents in NLN’s collection, the OCR accuracy is insufficient. Given that OCR quality affects downstream processes, evaluating and improving OCR for text written in Sámi languages is necessary to make these resources accessible. To address this need, this work fine-tunes and evaluates three established OCR approaches, Transkribus, Tesseract and TrOCR, for transcribing Sámi texts from NLN’s collection. Our results show that Transkribus and TrOCR outperform Tesseract on this task, while Tesseract achieves superior performance on an out-of-domain dataset. Furthermore, we show that fine-tuning pre-trained models and supplementing manual annotations with machine annotations and synthetic text images can yield accurate OCR for Sámi languages, even with a moderate amount of manually annotated data.

## introduction optical character recognition (ocr) converts scanned documents into machine-readable text, which is crucial for making digitised materials available for search and analysis. for the national library of norway (nln), the ocr output, among others, facilitates search for the online library (nettbiblioteket 1 ) and underpins analysis tools like the dh-lab toolbox @xcite . however, while ocr quality is high for most norwegian documents, it falls short for sámi 1 https://www.nb.no/search documents. the resulting text is insufficient for both search and for use in research or as a basis for language technology. nln has material in five sámi languages: north sámi, south sámi, lule sámi, inari sámi and skolt sámi. thus, developing an accurate ocr model for sámi texts is important for nln's mission to store and disseminate the materials in the library collection. furthermore, for languages with limited resources, like sámi languages, it is vital that the available resources are accessible to be searched and used for research. this paper describes a twofold contribution towards this goal: of the around 650 000 books and 4.6 million newspaper issues in nln's digitised collection, about 3000 and 4500 are classified as sámi, respectively. the classification generally means that the texts are written in sámi, though some may just address sámi-related topics. with more than 20 000 speakers north sámi is the most widely spoken sámi language in norway, sweden and finland, and it makes up the largest part of the sámi collection at nln. the other sámi languages in nln's collection all have less than 500 speakers. south and lule sámi are spoken in norway and sweden, and the collection contains a good amount of south and lule sámi books. skolt sámi, previously spoken in norway and russia, is now mainly spoken in finland, along with inari sámi, which has only ever been spoken in finland. there is much less material in these languages in the collection (< 20 books in total). all five languages have standardised orthographies that were made or revised in the 1970s, 80s or 90s @xcite @xcite , but the collection also includes earlier works that predate the standardised norms. to some extent these books contain nonstandard letters or glyph-shapes and most words are spelled in ways differing from contemporary orthographies. the sámi written languages have letters not found in the norwegian alphabet, but it varies from language to language which letters and how many. the alphabets have some letters in common, but none are identical. see ## results code for training tesseract and trocr models, creating synthetic data and more detailed dataset information is available through the supplement on github 25 . ## discussion and conclusions from tables 3 and 4 , we observe a jump in performance for the test set compared to the validation set. this increase is expected, as the test set annotations are of higher quality (more accurate line segmentations). we see that applying a two-stage training using synthetic data for the first stage always improved the results. as such, if manual annotations are limited, the addition of synthetic data is worth considering. furthermore, while the pred-sámi improved performance, its effect was less than including synthetic data. it would, thus, be interesting to investigate if further training on synth-sámi could eliminate the effect of pred-sámi. finally, we note that including gt-nor had a minimal effect when combined with pred-sámi. this finding, combined with the effect of pre-trained base models, suggests that language-independent features are already learned by the base models and highlights the value of language-specific data for fine-tuning on low-resource languages. unfortunately, as this work focuses on lowresource languages, few digitised texts exist. there is, therefore, a slight overlap between the books (but not pages) in the test set and the validation and training sets for inari sámi which could bias our results for the inari sámi language. still, inari sámi obtained the worst cer and wer for transkribus and the worst cer and second worst wer for tesseract. despite low amount of inari sámi, we included it in our analysis as there is an overlap between this alphabet and the north all models improved considerably compared to the baseline and are good candidates for a re-ocr process. if transcription accuracy is the main focus, then transkribus appears to perform the best. however, while tesseract achieved the worst performance for the nln test set, it performed the best on the ood giellatekno test set. tesseract also has other benefits: it is available as opensource software and requires less compute than a trocr model. while language-specific annotations are valuable, they are demanding to create, particularly for low-resource languages without good base models for semi-automatic annotations. however, our results show that by fine-tuning pre-trained models and augmenting manually annotated data with machine-annotated data and synthetic text images, we can achieve accurate ocr for sámi languages, even with modest amounts of manual annotations.