Introduction
Sanskrit presents a unique "perfect storm" of challenges for Natural Language Processing (NLP). It features free word order, where grammatical meaning is independent of word position, and is morphologically rich, often resulting in syncretism—where identical-looking surface forms represent different roots or grammatical categories.
The primary hurdle, however, is Sandhi—phonetic transformations at word boundaries where words blend together in writing (e.g., "go out" sounding like "gout"). This obscures word boundaries and modifies the characters themselves. Traditional sequential "lattice-based" models struggle because local decisions often require global context. This paper introduces a novel energy-based model (EBM) that jointly tackles word segmentation and morphological tagging by representing sentences as graphs of potential candidates rather than linear sequences.
Methods
The authors move away from sequential labeling toward a structured prediction framework using an Energy-Based Model (EBM).
- Sentence Graph Construction: Using the Sanskrit Heritage Reader (SHR) lexicon, the system builds a graph where every phonetically valid word split is a node.
- Edge Formation: Directed edges connect nodes that could co-occur in a valid segmentation, making the model "word-order agnostic."
- Energy Function: The model assigns an "energy" (cost) to configurations. The objective is to find the "maximal clique"—a subset of nodes where every node is connected to every other—with the lowest total energy.
- Inference: A greedy heuristic inspired by Prim’s algorithm is used to find this minimal-energy clique.
- Feature Generation: The Path Ranking Algorithm (PRA) automates feature selection based on morphological constraints (gender, number, case agreement) derived from a large tagged corpus.
Datasets and Evaluation
The study utilizes the Digital Corpus of Sanskrit (DCS), a massive collection of digitized texts spanning 3,000 years.
- Training: The model achieves peak performance with only 8,200 to 10,000 sentences.
- Testing: Evaluation was performed on "DCS10k" and "DCS4k" subsets to compare against previous state-of-the-art models.
Key Results
The proposed Clique-EBM significantly outperforms existing deep learning approaches, particularly in segmentation and joint tagging tasks.
- Word Prediction Task (WPT): The model achieved an F-Score of 96.92%, a 7.06% improvement over the previous best attention-based Seq2Seq model.
- Joint Task (WP3T): For combined segmentation, lemma identification, and morphological tagging, the model reached an F-Score of 90.45%.
- Perfect Matching (PM): The percentage of sentences with entirely correct word and tag identification jumped to 78.83%, up from 55.99% in the previous best system.
Discussion and Insights
- Global Context: Unlike LSTMs or CRFs that lose track of distant dependencies in long sentences, the graph-based EBM considers the entire sentence context simultaneously, which is vital for a free-word-order language.
- Data Efficiency: The model is remarkably lean, outperforming neural networks while using only 7.66% of the training data. This is a significant advantage for low-resource historical languages.
- Graph vs. Lattice: Switching from a traditional sequential lattice to a non-sequential graph approach yielded a 12.6% gain in F-Score.
Limitations and Future Work
The model's primary dependency is the Sanskrit Heritage Reader (SHR) lexicon; it cannot identify words absent from the lexicon. Additionally, the current model does not fully account for the internal structure of complex Sanskrit compounds. Future research will focus on more sophisticated graph pruning to maintain computational efficiency for dense, poetic verses.
Summary updated