Unlocking Knowledge with OCR -Driven Document Digitization for P eruvian Indigenous Languages (2024)

Abstract: The current focus on resource-rich languages poses a challenge to linguistic diversity, affecting minority languages with limited digital presence and relatively old published and unpublished resources. In addressing this issue, this study targets the digitalization of old scanned textbooks written in four Peruvian indigenous languages (Asháninka, Shipibo-Konibo, Yanesha, and Yine) using Optical Character Recognition (OCR) technology. This is complemented with text correction methods to minimize extraction errors. Contributions include the creation of an annotated dataset with 454 scanned page images, for a rigorous evaluation, and the development of a module to correct OCR-generated transcription alignments.

## introduction natural language processing (nlp) has prompted the development of diverse language technologies, including machine translation, spell checkers, and information extraction tools. given this impact, there is an urgent need to democratize these technologies, making them available for speakers of the more than 7,000 languages spoken worldwide. currently, such technologies are restricted to languages with ample linguistic resources that are easily exploitable @xcite . this presents a challenge for minority languages due to their limited digital presence and the prevalence of their resources in less accessible formats, hindering their incorporation into the development of these technologies @xcite . consequently, speakers of minority languages are forced to adopt languages with greater technological access, leading to a loss of cultural, historical, and linguistic knowledge. to address this situation, multiple efforts are underway to diversify these technologies to minority languages and their speakers, who face the challenge of overcoming data availability limitations. in some cases, synthetic data has been generated @xcite , translations to languages with more resources have been utilized @xcite , and technologies have been adapted for dataset extraction and processing @xcite . however, identifying digital sources of knowledge for endangered languages is a very challenging task, as they are not usually available on the web @xcite , which is the case for several indigenous languages of peru. in this context, optical character recognition (ocr) models have been useful to extract information and new resources for endangered language texts @xcite . for this reason, we extend the application of ocr for digitizing old documents, with typewritten texts, in four peruvian languages (asháninka, shipibo-konibo, yanesha, and yine), using optical character recognition (ocr), and followed by correction methods to minimize extraction errors (see figure 1 ). ## language context according to official statistics, 48 languages are spoken in peru. 44 out of these 48 languages are amazonian languages (de educación del peru, 2013). the four languages this paper is focused on (shipibo-konibo, asháninka, yanesha, and yine) are amazonian languages. asháninka, belonging to the nijagantsi branch of the arawak language family, is primarily spoken in the central peruvian amazonia, along the low perené, tambo, ene, urubamba, and apurímac rivers @xcite . although the asháninka population is estimated to be around 70,000 speakers (pedrós, 2018), it remains unclear if this count includes speakers of ashéninka, a closely related language. yine and yanesha are also languages of the arawak family. yine is spoken by approximately 3,000 people living near the ucayali and madre de dios rivers. yanesha, in turn, is spoken by 1,142 people in the peruvian department of pasco. yanesha people generally express concern for their language, since very few children speak it and speakers are mostly over 30 years old. both yine and yanesha are classified as "definitely endangered" according to the unesco atlas of the world's languages in danger @xcite . with an estimated 40,000 speakers, shipibo-konibo is by large the most vital language in the pano language family. it is predominantly spoken in the peruvian regions of ucayali and loreto, along the ucayali river and its tributaries @xcite . it is important to mention that there is a relatively large shipibo-konibo community in lima. ## related work the correction of ocr transcripts has seen the application of various methodologies, ranging from manual and resource-intensive approaches to more recent and prevalent machine learning models, particularly those based on neural networks (see @xcite for further details). the effectiveness of applications such as language models, translation models, and spell checkers in rectifying ocr errors is well-established. for instance, @xcite employed a statistical machine translation (smt) model, while schulz and kuhn (2017) combined such models with spell checkers. furthermore, sequence-to-sequence neural networks have emerged as successful models in correcting ocr transcripts, especially in scenarios with limited data availability. @xcite developed a model that effectively learned from limited data for languages like ainu, griko, and yakkha by leveraging existing translations. this approach was further enhanced in @xcite through the incorporation of lexical decod-ing and self-training strategies, achieving significant improvements (up to 29%). for sanskrit texts, maheshwari et al. (2022) obtained favorable results by considering both phonetic encoding and the language's official alphabet. ## methodology for dataset creation 4.1 data selection we sourced documents from the sil international foot_0 repository, targeting materials written in four languages: asháninka, shipibo-konibo, yanesha and yine. these languages were chosen for their availability of resources within the repository compared to other peruvian languages foot_1 . the documents, primarily in pdf format, present a wide range of contents, attributes, and layouts, including typewritten and handwritten text, tables, and images. additionally, the content may be organized in multiple columns and vary in font sizes, sometimes presented in multiple languages. to ensure dataset consistency, we focused on a subset of monolingual, typewritten documents with uniform font sizes. from each document, we selected a sample of pages (10%) for annotation and evaluation, based on criteria such as readability, resolution, tilt, and content alignment. ## ocr process we employed two ocr systems, google vision foot_6 (version 3.4.4) and tesseract foot_7 (version 5.3.3), to generate initial text transcriptions. although neither system directly supports the languages studied, they recognize the common latin script shared by these languages. previous research has demonstrated their effectiveness in low-resource language settings, including sanskrit (maheshwari et al., 2022), ainu, griko, yakka (rijhwani et al., 2020), tamil, and sinhala @xcite . after the initial ocr transcriptions, a two-step preprocessing stage was implemented to enhance output quality. we evaluated the results using two standard metrics: character error rate (cer) and word error rate (wer). these metrics quantify ocr accuracy based on the levenshtein distance, which measures the minimum number of edit operations (substitutions, deletions, insertions) required to transform the original text into the ocrgenerated text @xcite . ## conclusions and future work this work digitized textbooks in four peruvian languages using ocr systems. we contributed an annotated dataset to assess the performance of google vision and tesseract ocrs. google vision demonstrated higher accuracy in character recognition, while tesseract excelled in maintaining text order across multiple columns. to address google vision's limitation in maintaining text order, we developed an alignment module. additionally, we evaluated five error correction methods and found that the singlesource model, designed for learning from limited data, was the most effective, particularly in correcting characters with diacritics. future efforts aim to optimize the hyperparameters of the singlesource model and implement the multi-source model by @xcite to leverage spanish translations available for 89% of the books. fadoua ataa allah, siham boulaknadel, and seth darren. 2023. new trends in less-resourced language processing: case of amazigh language. 12. gina bustamante, arturo oncevay, and roberto zariquiey. 2020. no data to crawl? monolingual corpus creation from pdf files of truly low-resource languages in peru. in proceedings of the twelfth language resources and evaluation conference, pages 2914-2923, marseille, france. european language resources association. ministerio de educación del peru. 2013. documento nacional de lenguas originarias del perú. lima. wei-jen ko, ahmed el-kishky, adithya renduchintala, vishrav chaudhary, naman goyal, francisco guzmán, pascale fung, philipp koehn, and mona diab. 2021. adapting high-resource nmt models to translate low-resource related languages without parallel data. ayush maheshwari, nikhil singh, amrith krishna, and ganesh ramakrishnan. 2022. a benchmark and dataset for post-ocr text correction in sanskrit. christopher moseley, editor. 2010. atlas of the world's languages in danger, 3rd edition. unesco, paris, france. clemens neudecker, konstantin baierer, mike gerber, christian clausner, apostolos antonacopoulos, and stefan pletschacher. 2021. a survey of ocr evaluation tools and metrics. in proceedings of the 6th international workshop on historical document imaging and processing, hip '21, page 13-18, new york, ny, usa. association for computing machinery. thi tuyet hai nguyen, adam jatowt, mickael coustaty, and antoine doucet. 2021. survey of post-ocr processing approaches. acm comput. surv., 54(6). arturo oncevay, gerardo cardoso, carlo alva, césar lara ávila, jovita vásquez balarezo, saúl escobar rodríguez, delio siticonatzi camaiteri, esaú zumaeta rojas, didier lópez francis, juan lópez bautista, nimia acho rios, remigio zapata cesareo, héctor erasmo gómez montoya, and roberto zariquiey. 2022. schaman: spell-checking resources and benchmark for endangered languages from amazonia. in proceedings of the 2nd conference of the asia-pacific chapter of the association for computational linguistics and the 12th international joint conference on natural language processing (volume 2: short papers), pages 411-417, online only. association for computational linguistics. toni pedrós. 2018. ashéninka y asháninka: ¿de cuántas lenguas hablamos? cadernos de etnolingüística, 6(1):1-30. shruti rijhwani, antonios anastasopoulos, and graham neubig. 2020. ocr post correction for endangered language texts. in proceedings of the 2020 conference on empirical methods in natural language processing (emnlp), pages 5931-5942, online. association for computational linguistics. shruti rijhwani, daisy rosenblum, antonios anastasopoulos, and graham neubig. 2021. lexically aware semi-supervised learning for ocr postcorrection. sarah schulz and jonas kuhn. 2017. multi-modular domain-tailored ocr post-correction. in proceedings of the 2017 conference on empirical methods in natural language processing, pages 2716-2726, copenhagen, denmark. association for computational linguistics. pilar m. valenzuela. 2003. transitivity in shipibo-konibo grammar. ph.d. thesis, eugene: university of oregon, eugene, or. charangan vasantharajan, laksika tharmalingam, and uthayasanker thayasivam. 2022. adapting the tesseract open-source ocr engine for tamil and sinhala legacy fonts and creating a parallel corpus for tamilsinhala-english. in 2022 international conference on asian language processing (ialp). ieee. a spell checker assessment with standardized texts due to the spell checker's limitations in correcting ocr transcripts using the standardization approach, we assessed a small set of 50 sentences. this evaluation compared the spell checker's corrections with the original texts in their standardized versions. we manually standardized 25 sentences in both yanesha and shipibo-konibo languages with the support of native speakers to ensure accuracy. despite this fair comparison to the standardized texts, we noted no improvement in the cer and wer values. moreover, opportunities for enhancement remain in both the denorm and ensemble models proposed in oncevay et al. (2022).