Masked Language Model for Ancient Sanskrit Text Restoration
摘要
Sanskrit’s rich history and significant cultural relevance provide a particular challenge to Natural Language Processing (NLP) tasks due to its complicated grammatical structure and limited digital resources. Many Sanskrit manuscripts have been damaged over time, containing corrupted passages and missing content. Traditional NLP methods often need help to handle complex languages like Sanskrit properly. Furthermore, the need for more annotated Sanskrit corpora poses difficulties in developing accurate computational models to restore fragmented heritage documents. To address this need, a masked language model based on BERT (Bidirectional Encoder Representations from Transformers) architecture is proposed to accurately predict missing Sanskrit tokens based solely on semantic and grammatical contextual clues. This data-driven approach can help reconstruct damaged parts of historical texts without expensive manual effort. Additionally, a tailored byte-pair encoding tokenizer is developed to handle the language’s morphology and script conventions. The experiments demonstrate that the proposed model combined with the custom tokenizer outperforms previous Sanskrit state-of-the-art by significant margins. This research investigates using Masked Language Models (MLMs) to capture the semantic and grammatical nuances of this ancient language without relying heavily on large-scale annotation. The purpose is to assess these models’ capabilities for restoring corrupted Sanskrit texts. The model is assessed using metrics like Character Error Rate (CER) and Hit@K, analyzing its strengths and weaknesses. The results show that BertMaskedLM has significant potential for processing the Sanskrit language. This research opens possibilities for utilizing modern deep learning to recover lost information and fill textual gaps in ancient Sanskrit corpora. With further research to address current limitations, masked language models can become invaluable tools for preserving and restoring Sanskrit heritage using AI.