TransLIST: A Transformer-Based Linguistically Informed Sanskrit Tokenizer

Jivnesh Sandhan, Rathin Singha, Narein Rao, Suvendu Samanta, Laxmidhar Behera, Pawan Goyal

Introduction

Sanskrit Word Segmentation (SWS) is a foundational task in Natural Language Processing for Sanskrit, complicated by the phonetic phenomenon of sandhi. Sandhi involves the blending of sounds at word boundaries through deletion, insertion, or substitution, effectively obscuring word limits. For instance, the compound śvetodhāvati ("the white horse runs") is formed from the underlying words śvetaḥ and dhāvati.

Existing approaches typically fall into two categories: lexicon-driven systems, which are linguistically accurate but fail on out-of-vocabulary (OOV) terms, and neural engineering approaches, which are robust but prone to ungrammatical "hallucinations." TransLIST, presented at EMNLP 2022, proposes a hybrid architecture that integrates linguistic priors into a deep learning framework to achieve state-of-the-art performance.

Methodology

TransLIST employs a three-pronged strategy to bridge the gap between rule-based and neural methods:

  1. Linguistically Informed Sanskrit Tokenizer (LIST): This module augments character-level inputs with latent word information. It utilizes the Sanskrit Heritage Reader (SHR) to identify candidate words. To ensure robustness against OOV words, the system falls back to n-gram structures when the lexicon-driven parser yields no results.
  2. Soft-Masked Attention (SMA): Unlike standard self-attention, SMA introduces an inductive bias by prioritizing candidate words that encompass the character being predicted. It incorporates span position encoding to model the overlapping nature of candidate segments.
  3. Path Ranking for Corrupted Predictions (PRCP): As a post-processing step, PRCP ensures the neural network's output forms valid words. It treats segmentation as a path-finding problem, scoring candidates based on model log-likelihood, character-level language model perplexity, and word count penalties.
The TransLIST architecture: (a) extraction of candidate solutions from SHR or n-grams, and (b) the Transformer encoder integrated with the SMA module.

Results and Discussion

Evaluated on the Digital Corpus of Sanskrit (DCS) benchmarks (SIGHUM and Hackathon), TransLIST established a new state-of-the-art. On the SIGHUM dataset, it achieved a 93.97% Perfect Match (PM) score, representing a 7.2-point absolute improvement over previous models like rcNN-SS.

Ablation studies highlight the critical role of linguistic integration. The removal of the LIST module resulted in the most significant performance degradation, confirming that pure deep learning is insufficient for morphologically complex languages like Sanskrit. Furthermore, the SMA mechanism allows the model to treat linguistic suggestions as soft constraints, maintaining flexibility for OOV words while benefiting from dictionary knowledge.

Ablation study results demonstrating the performance impact of removing key components like LIST, SMA, and PRCP.

Conclusion

TransLIST demonstrates that combining traditional linguistic resources with modern Transformer architectures significantly enhances Sanskrit word segmentation. While the PRCP module introduces some inference latency (approx. 105ms per sample), the gains in accuracy and robustness are substantial. Future work will focus on optimizing inference speed and extending the framework to multi-task learning for morphological tagging and dependency parsing.

Summary updated

BibTeX
@inproceedings{sandhan2022translist,
  author = {Jivnesh Sandhan and Rathin Singha and Narein Rao and Suvendu Samanta and Laxmidhar Behera and Pawan Goyal},
  title = {{TransLIST: A Transformer-Based Linguistically Informed Sanskrit Tokenizer}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.findings-emnlp.513},
}
Figure