Digitizing Nepal's Written Heritage: A Comprehensive HTR Pipeline for Old Nepali Manuscripts
Paper · 2026 · Anjali Sarawgi, Esteban Garces Arias and Christof Zotter
Summary
Old Nepali is a low-resource historical language, and no handwritten text recognition (HTR) system existed for it. The authors build the first full HTR pipeline for Old Nepali manuscripts in Devanagari. Most of these documents are 18th–19th-century royal edicts and petitions from the NGMPP collection. The scripts are hard to read because of scriptio continua, complex conjuncts, inconsistent spelling and degraded pages. Pages are split into lines with Kraken. Models are then trained in three stages: synthetic rendered Devanagari text, then printed Devanagari, then the annotated manuscripts. The study compares TrOCR and Swin Transformer encoders paired with BERT-style or GPT-2 decoders. It also tests byte-level versus conventional tokenization, script-preserving augmentation, label normalization and a range of deterministic and stochastic decoding methods. The best model reaches a Character Error Rate of 4.9%, and the authors report it outperforms open-source and proprietary tools. Data-centric steps mattered more than the choice of architecture. The released code and models offer a practical baseline for digitizing South Asian manuscript archives.
Key points
- The manuscript dataset has 155 images segmented into 3,100 lines, averaging about 60 characters per line, with an 80/10/10 split. This evaluation data is confidential.
- Stage-one pretraining uses 105,000 synthetic line images rendered from Internet Archive Nepali textbooks. The images combine 11 fonts and 10 noise or distortion effects, split into 100,000 for training and 2,500 each for validation and testing.
- Decoder type (BERT-style vs. GPT-2) and tokenization scheme barely changed results. Augmentation and label normalization gave the largest gains.
- Most errors come from visually similar characters (e.g., y vs. p), and accuracy drops on lines longer than 120 characters.
- Code, model configurations and evaluation scripts are available at github.com/anjalisarawgi/nepOCR.
Institutions
Fields, topics and concepts
📚 Shelves 5The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksComputer Vision and Pattern Recognition · 2,869 worksEngineering · 133 worksHuman-Computer Interaction · 141 worksMedia Technology · 34 works
Cite
Cite as Anjali Sarawgi, Esteban Garces Arias and Christof Zotter. 2026. Digitizing Nepal's Written Heritage: A Comprehensive HTR Pipeline for Old Nepali Manuscripts. Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers).
@inproceedings{sarawgi2026digitizing,
title = {{Digitizing Nepal's Written Heritage: A Comprehensive HTR Pipeline for Old Nepali Manuscripts}},
author = {Anjali Sarawgi, Esteban Garces Arias and Christof Zotter},
booktitle = {Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
year = {2026},
doi = {10.18653/v1/2026.acl-long.671},
url = {https://doi.org/10.18653/v1/2026.acl-long.671}
}References
- David H Ackley, Geoffrey E Hinton, and Terrence J Sejnowski. 1985. A learning algorithm for boltzmann machines. Cognitive science, 9(1):147–169. find
- Wissam AlKendi, Franck Gechter, Laurent Heyberger, and Christophe Guyeux. 2024. Advancements and challenges in handwritten text recognition: A comprehensive survey. Journal of Imaging, 10(1). find
- G. Bradski. 2000. The OpenCV Library. Dr. Dobb’s Journal of Software Tools. find
- Edgard Chammas, Chafic Mokbel, and Laurence Likforman-Sulem. 2018. Handwriting recognition of historical documents with few labeled data. In 2018 13th IAPR International Workshop on Document Analysis Systems (DAS), pages 43–48. find
- Simon Cubelic, Axel Michaels, and Astrid Zotter. 2018. Towards a South Asian Diplomatics: Cosmopolitan Norms and Regional Idioms in the Use of Documents, pages 1–33. In Studies in Historical Documents from Nepal and India, Documenta Nepalica: Book Series. Heidelberg University Publishing. find
- Arthur Flor de Sousa Neto, Byron Leite Dantas Bezerra, Gabriel Calazans Duarte de Moura, and Alejandro Héctor Toselli. 2024. Data augmentation for offline handwritten text recognition: A systematic literature review. SN Computer Science, 5(2). find
- Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of NAACL-HLT.
- Yuanhao Ding, Esteban Garces Arias, Meimingwei Li, Julian Rodemann, Matthias Aßenmacher, Danlu Chen, Gaojuan Fan, Christian Heumann, and Chongsheng Zhang. 2025. Guard: Glocal uncertainty-aware robust decoding for effective and efficient open-ended text generation. Preprint, arXiv:2508.20757. find
- Yuanhao Ding, Meimingwei Li, Esteban Garces Arias, Matthias Aßenmacher, Christian Heumann, and Chongsheng Zhang. 2026. Min-k sampling: Decoupling truncation from temperature scaling via relative logit dynamics. Preprint, arXiv:2604.11012. find
- Angela Fan, Mike Lewis, and Yann Dauphin. 2018. Hierarchical neural story generation. Preprint, arXiv:1805.04833.
- Markus Freitag and Yaser Al-Onaizan. 2017. Beam search strategies for neural machine translation. In Proceedings of the First Workshop on Neural Machine Translation. Association for Computational Linguistics.
- Esteban Garces Arias, Meimingwei Li, Christian Heumann, and Matthias Assenmacher. 2025. Decoding decoded: Understanding hyperparameter effects in open-ended text generation. In Proceedings of the 31st International Conference on Computational Linguistics, pages 9992–10020, Abu Dhabi, UAE. Associatio…
- Esteban Garces Arias, Vallari Pai, Matthias Schöffel, Christian Heumann, and Matthias Aßenmacher. 2023. Automatic transcription of handwritten old Occitan language. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 15416–15439, Singapore. Association fo… find
- Esteban Garces Arias, Julian Rodemann, Meimingwei Li, Christian Heumann, and Matthias Aßenmacher. 2024. Adaptive contrastive search: Uncertainty-guided decoding for open-ended text generation. In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 15060–15080, Miami, Florida… find
- Alex Graves and Jürgen Schmidhuber. 2008. Offline handwriting recognition with multidimensional recurrent neural networks. In Advances in Neural Information Processing Systems, volume 21. Curran Associates, Inc. find
- Ankush Gupta, Andrea Vedaldi, and Andrew Zisserman. 2016. Synthetic data for text localization in natural images. In European Conference on Computer Vision, pages 231–246. find
- Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. 2019. The curious case of neural text degeneration. arXiv preprint arXiv:1904.09751.
- Internet Archive. 2025. Internet Archive. https://archive.org. Accessed: 2025-07-10. ↗
- Benjamin Kiessling. 2019. Kraken - A Universal Text Recognizer for the Humanities. In Digital Humanities 2019, Utrecht, Netherlands. find
- Philipp Koch, Gilary Vera Nuñez, Esteban Garces Arias, Christian Heumann, Matthias Schöffel, Alexander Häberlin, and Matthias Assenmacher. 2023. A tailored handwritten-text-recognition system for medieval Latin. In Proceedings of the Ancient Language Processing Workshop, pages 103–110, Varna, Bulgar… find
- Taku Kudo. 2018. Subword regularization: Improving neural network translation models with multiple subword candidates. arXiv preprint arXiv:1804.10959.
- Minghao Li, Tengchao Lv, Lei Cui, Yijuan Lu, Dinei Florencio, Cha Zhang, Zhoujun Li, and Furu Wei. 2023. Trocr: Transformer-based optical character recognition with pre-trained models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pages 13094–13102. find
- Ze Liu, Yutong Hu, Yixuan Lin, Zhicheng Lin, Zihang Gao, Ze Han, Xiang Chen, and et al. 2021. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030.
- Nicole Merkel-Hilf. 2022. printed Devanagari. find
- Ground Truth data for Anthony Moi and Nicolas Patry. 2023. HuggingFace’s Tokenizers. find
- Swornim Nakarmi, Sarin Sthapit, Arya Shakya, Rajani Chulyadyo, and Bal Krishna Bal. 2024. Nepal script text recognition using CRNN CTC architecture. In Proceedings of the 3rd Annual Meeting of the Special Interest Group on Under-resourced Languages @ LREC-COLING 2024, pages 244–251, Torino, Italia.… find
- Joseph Nockels, Paul Gooding, and Melissa Terras. 2024. The implications of handwritten text recognition for accessing the past at scale. Journal of Documentation, 80(7):148–167. find
- Nobuyuki Otsu. 1979. A threshold selection method from gray-level histograms. IEEE Transactions on Systems, Man, and Cybernetics, 9(1):62–66. find
- Mahes Raj Pant and Philip H. Pierce. 1989. Administrative Documents of the Shah Dynasty Concerning Mustang and Its Periphery (1789–1844 A.D.), volume 10 of Archiv für Zentralasiatische Geschichtsforschung. VGH Wissenschaftsverlag, Bonn. find
- John Pavlopoulos, Vasiliki Kougia, Esteban Garces Arias, Paraskevi Platanou, Stepan Shabalin, Konstantina Liagkou, Emmanouil Papadatos, Holger Essler, Jean-Baptiste Camps, and Franz Fischer. 2024. Challenging error correction in recognised byzantine Greek. In Proceedings of the 1st Workshop on Machi… find
- Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. OpenAI. find
- Yassin Hussein Rassul, Aram M. Ahmed, Polla Fattah, Bryar A. Hassan, Arwaa W. Abdulkareem, Tarik A. find
- Rashid, and Joan Lu. 2025. Advancing offline handwritten text recognition: A systematic review of data augmentation and generation techniques. Preprint, arXiv:2507.06275. — [arXiv:2507.06275](https://arxiv.org/abs/2507.06275) find
- Theodore Jr. Riccardi. 1971. A Nepali Version of the Vetâlapañcavim . śati, volume 54 of American Oriental Series. American Oriental Society, New Haven. find
- Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. Preprint, arXiv:1508.07909.
- Baoguang Shi, Xiang Bai, and Cong Yao. 2017. An end-to-end trainable neural network for image-based sequence recognition and its application to scene text recognition. IEEE Trans. Pattern Anal. Mach. Intell., 39(11):2298–2304. find
- Raymond Smith. 2007. An overview of the tesseract OCR engine. In Proc. 9th Int. Conf. on Document Analysis and Recognition (ICDAR), pages 629–633. find
- Mohamed Ali Souibgui, Alicia Fornés, Yousri Kessen-tini, and Beáta Megyesi. 2022. Few shots are all you need: A progressive learning approach for low resource handwritten text recognition. Pattern Recognition Letters, 160:43–49. find
- Phillip Benjamin Ströbel, Tobias Hodel, Walter Boente, and Martin Volk. 2023. The Adaptability of a Transformer-Based OCR Model for Historical Documents, page 34–48. Springer Nature Switzerland. find
- Yixuan Su, Tian Lan, Yan Wang, Dani Yogatama, Lingpeng Kong, and Nigel Collier. 2022. A contrastive framework for neural text generation. In Advances in Neural Information Processing Systems, volume 35, pages 21548–21561. find
- Curtis Wigington, Seth Stewart, Brian Davis, Bill Barrett, Brian Price, and Scott Cohen. 2017. Data augmentation for recognition of handwritten words and lines using a cnn-lstm network. In 2017 14th IAPR International Conference on Document Analysis and Recognition (ICDAR), page 639–645. IEEE. find
- Curtis Wigington, Chris Tensmeyer, Brian Davis, William Barrett, Brian Price, and Scott Cohen. 2018. Start, follow, read: End-to-end full-page handwriting recognition. In Computer Vision – ECCV 2018, pages 372–388, Cham. Springer International Publishing. find
- Christof Zotter. 2018. Ascetics in Administrative Affairs: Documents on the Central Overseers of Jogı̄s and Sam . nyāsı̄s in Nepal, page 445–491. In Studies in Historical Documents from Nepal and India, Documenta Nepalica: Book Series. Heidelberg University Publishing. find
- Rājendra Vikrama Śāha. 1832. A lālamohara granting Munsı̄ Laks.mı̄dāsa a piece of land at Madu Tola as sunābirtā. Heidelberg: HAdW (Documenta Nepalica). find
- VS 1889. Edited and translated by Manik Bajracharya. Published in 2017. find
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/sarawgi-2026-digitizing-nepal-s-written-heritage/