Abstract
Digitizing ancient Sanskrit texts in Romanised script (IAST) is hindered by the lack of specialized OCR models and the prevalence of noise in historical manuscripts. This paper presents a post-OCR correction framework that "upcycles" generic Roman-script OCR outputs. By employing a monotone Seq2Seq architecture with a copying mechanism (CopyNet) and sub-word encoding (BPE), the proposed system achieves significant accuracy gains on low-quality scans, outperforming standard commercial solutions.
1. Introduction
The digitization of scholarly Sanskrit editions often relies on the International Alphabet of Sanskrit Transliteration (IAST). However, standard OCR engines, typically optimized for English, struggle with the 14 unique Sanskrit characters that utilize diacritics (e.g., ā, ṃ, ṣ). On historical manuscripts characterized by stains, faded ink, or low scan resolution, standard OCR Character Recognition Rates (CRR) can plummet to as low as 35%, rendering the output unusable without extensive manual intervention.
2. Methodology
Rather than developing a de novo OCR engine, this research proposes a neural post-correction pipeline. The system takes the flawed output of a standard OCR (like Tesseract) and processes it through a character-level encoder-decoder framework.
2.1 CopyNet and BPE
The core innovation is the CopyNet mechanism. Given that OCR output is frequently partially correct, the model learns to either "copy" a character directly from the input or "generate" a new one when an error is detected. This approach is significantly more efficient than full text regeneration. To handle Sanskrit's rich morphology and rare inflections, the authors utilize Byte Pair Encoding (BPE) to decompose words into sub-word units.
2.2 Synthetic Data Generation
To overcome the scarcity of annotated training data, the authors generated OCRTrain, a synthetic dataset of 50,000 lines. They applied programmatic noise—including erosion, perspective distortion, and salt-and-pepper grain—to clean digital text to simulate real-world manuscript conditions.
3. Results and Discussion
The proposed CopyNet+BPE model was evaluated on OCRTest, a manually annotated benchmark from the Bhagavad Gita and Vishnu Sahasranama.
3.1 Performance Metrics
The model demonstrated remarkable robustness to noise. On the highly degraded Sahasranama dataset, the raw OCR's CRR of 35.76% was boosted to 87.01% by the CopyNet model. Furthermore, the system achieved a Word Recognition Rate (WRR) of 68.71% on the combined test set, surpassing Google OCR's performance of 60.91%.
3.2 Key Insights
- Upcycling Efficiency: By bridging the 13-character gap between English and Sanskrit graphemes, the model effectively repurposes existing high-resource OCR tools.
- Contextual Correction: Processing text at the line level allows the RNN to utilize surrounding context to accurately predict missing diacritics.
- Human-in-the-loop: Expert surveys indicated that CopyNet's output is significantly faster to manually correct than baseline outputs, highlighting its practical utility for linguists.
4. Conclusion and Future Work
While the system excels at substitution corrections, it remains challenged by insertion errors where the OCR adds extraneous characters. Future research will focus on generalizing noise simulation to make the model more adaptable to diverse manuscript styles without requiring extensive fine-tuning. This "upcycling" approach provides a scalable pathway for the high-fidelity digitization of low-resource historical languages.
Summary updated