Vedika - Sanskrit NLP Toolkit
Vedika is a comprehensive toolkit for Sanskrit text processing, offering deep learning-based tools for sandhi splitting and joining, text normalization, sentence splitting, syllabification, and tokenization.
Features
- Sandhi Processing
- Split compound Sanskrit words using attention-based neural networks
- Join Sanskrit words with proper sandhi rules
- Support for beam search to get multiple suggestions
- Text Processing
- Syllabification
- Tokenization
- Sentence splitting
- Text normalization
Installation
# Install from PyPI
pip install vedika
Requirements
- Python >= 3.8
- PyTorch >= 1.9.0
- NumPy >= 1.19.0
- Pandas >= 1.3.0
- tqdm >= 4.62.0
- regex >= 2021.8.3
Quick Start
Sandhi Splitting
from vedika import SanskritSplit
# Initialize splitter
splitter = SanskritSplit()
# Split a single word
result = splitter.split("रामायणम्")
print(result['split']) # Output: राम + अयन + अम्
# Batch processing
words = ["रामायणम्", "गीतागोविन्दम्"]
results = splitter.split_batch(words)
for result in results:
print(f"{result['input']} → {result['split']}")
Sandhi Joining
from vedika import SandhiJoiner
# Initialize joiner
joiner = SandhiJoiner()
# Join split words
result = joiner.join("राम+अस्ति")
print(result) # Output: रामास्ति
# Batch processing
texts = ["राम+अस्ति", "गच्छ+अमि"]
results = joiner.join_batch(texts)
print(results) # ['रामास्ति', 'गच्छामि']
Advanced Usage
Beam Search for Multiple Suggestions
# Get multiple suggestions with beam search
result = splitter.split("रामायणम्", beam_size=3)
print(f"Best split: {result['split']}")
print(f"Confidence: {result['confidence']}")
print("Alternatives:")
for alt in result['alternatives']:
print(f"- {alt['split']} (confidence: {alt['confidence']})")
Model Information
# Get model details
info = splitter.get_model_info()
print(f"Vocabulary size: {info['vocabulary_size']}")
print(f"Device: {info['device']}")
print(f"Configuration: {info['model_config']}")
Project Structure
vedika/
├── __init__.py
├── normalizer.py
├── sandhi_join.py
├── sandhi_split.py
├── sentence_splitter.py
├── syllabification.py
├── tokenizer.py
└── data/
├── cleaned_metres.json
├── sandhi_joiner.pth
└── sandhi_split.pth
Model Architecture
The sandhi processing models use:
- Bidirectional LSTM encoder
- GRU decoder with attention
- Multi-head attention mechanism
- Character-level processing
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Authors
- Tanuj Saxena
- Soumya Sharma
Citation
If you use Vedika in your research, please cite:
@software{vedika2025,
title={Vedika: A Sanskrit Text Processing Toolkit},
author={Saxena, Tanuj and Sharma, Soumya},
year={2025},
url={https://github.com/tanuj437/vedika}
}
Contact
Metadata
Release files for vedika 0.0.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vedika-0.0.18.tar.gz | 26.0 kB | Without provenance | Details for vedika-0.0.18.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vedika-0.0.18-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for vedika-0.0.18-py2.py3-none-any.whl |
Total release size: 54.3 kB
Release files / vedika-0.0.18.tar.gz
| Download URL | vedika-0.0.18.tar.gz |
|---|---|
| Size | 26.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e42699adc859d73cb939e178c742c4d6abde7c79b071469c8c13f8534ea1f056
|
|
BLAKE2b-256 checksum How to use checksums |
2c0ed2ca51ee0e784ab9106b48b514c079a4048568d0fb9164f5700d74f1b142
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Release files / vedika-0.0.18-py2.py3-none-any.whl
| Download URL | vedika-0.0.18-py2.py3-none-any.whl |
|---|---|
| Size | 28.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
8d5c6812d621ca6f89d6a684d195b06b064da643e06e72af65d5aba06d0c8641
|
|
BLAKE2b-256 checksum How to use checksums |
8676ca947abbdb584d50081d17d308d48a8b94daa2df9db7156c85c6232e2fb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Security for vedika 0.0.18
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.