A native Grapheme-to-Phoneme (G2P) engine for Indian languages, built for neural TTS.
Part of the IndicVoice research project — a Kokoro-based decoder-only TTS system for Indic scripts.
Author: Kushal Kant Bind — Department of Mathematics, Chandigarh University
License: Apache 2.0
indic-g2p converts Indian language text into IPA phoneme sequences. It is the text frontend for IndicVoice, analogous to how Misaki serves Kokoro.
"नमस्ते दुनिया" → indic-g2p → n ə m əs t eː d ʊ n ɪ j aː
Indian Text
│
▼
indic-g2p ← this repo
(Script → IPA)
│
▼
IndicVoice Neural Decoder
(IPA → Mel → Audio)
│
▼
Speech Audio (24 kHz)
- Script Normalisation — Unicode NFC normalisation, conjunct decomposition, nukta and zero-width joiner (ZWJ) handling
- Rule-Based Phoneme Mapping — finite-state transducer maps each script character to IPA symbols with context-sensitive schwa deletion for Hindi/Marathi
- Exception Handler — lookup table for loanwords, numerals, abbreviations, and dialect-specific pronunciations; falls back to
espeak-ngfor unknown words
| Language | Code | Script | Status |
|---|---|---|---|
| Hindi | hi |
Devanagari | ✅ Active |
| Punjabi | pa |
Gurmukhi | 🔧 Beta |
| Bengali | bn |
Bengali | 🔧 Beta |
| Marathi | mr |
Devanagari | ⏳ Planned |
| Tamil | ta |
Tamil | ⏳ Planned |
| Telugu | te |
Telugu | ⏳ Planned |
| Kannada | kn |
Kannada | ⏳ Planned |
| Gujarati | gu |
Gujarati | ⏳ Planned |
| Odia | or |
Odia | ⏳ Planned |
| Malayalam | ml |
Malayalam | ⏳ Planned |
| Urdu | ur |
Nastaliq | ⏳ Planned |
| Assamese | as |
Bengali | ⏳ Planned |
| English | en |
Roman | ✅ Active (via espeak fallback) |
pip install indic-g2ppip install git+https://github.com/Bindkushal/indic-g2p.gitespeak-ng is a system-level package, not a Python package. Install it before using the fallback:
# Ubuntu / Debian / Colab
sudo apt-get install espeak-ng
# macOS
brew install espeak-ng
# Windows
# Download the .msi from https://github.com/espeak-ng/espeak-ng/releasespip install "indic-g2p[en]" # installs spacy for English processingfrom indicg2p import hi
g2p = hi.G2P()
phonemes, tokens = g2p("नमस्ते दुनिया")
print(phonemes)
# → n ə m əs t eː d ʊ n ɪ j aːfrom indicg2p import hi, espeak
fallback = espeak.EspeakFallback(lang='hi')
g2p = hi.G2P(fallback=fallback)
phonemes, tokens = g2p("नमस्ते OOV_word")
print(phonemes)from indicg2p import pa
g2p = pa.G2P()
phonemes, tokens = g2p("ਸਤਿ ਸ੍ਰੀ ਅਕਾਲ")
print(phonemes)from indicg2p import bn
g2p = bn.G2P()
phonemes, tokens = g2p("আমার সোনার বাংলা")
print(phonemes)indic-g2p/
├── indicg2p/
│ ├── __init__.py # language routing, LANG_CODES map
│ ├── token.py # Token dataclass
│ ├── transcription.py # text chunking and normalisation
│ ├── espeak.py # espeak-ng fallback for OOV words
│ ├── hi.py # Hindi G2P
│ ├── pa.py # Punjabi G2P
│ ├── bn.py # Bengali G2P
│ └── data/
│ ├── hi_dict.json # Hindi pronunciation dictionary
│ ├── pa_dict.json # Punjabi dictionary
│ └── bn_dict.json # Bengali dictionary
├── examples/
├── tests/
├── pyproject.toml
└── README.md
Every language module exposes the same interface:
class G2P:
def __init__(self, fallback=None):
"""
fallback: optional EspeakFallback instance for OOV words.
If None, OOV words are passed through unchanged.
"""
def __call__(self, text: str) -> tuple[str, list]:
"""
Args:
text: Input string in the target script.
Returns:
phonemes: Space-separated IPA string.
tokens: List of Token objects with grapheme/phoneme pairs.
"""We welcome contributions for any Indian scheduled language.
- Fork this repo
- Create
indicg2p/XX.py(ISO 639-1 code) - Implement
class G2Pwith__call__(text) -> (phonemes, tokens) - Add dictionary at
indicg2p/data/XX_dict.json - Register in
indicg2p/__init__.pyunderLANG_CODES - Add tests in
tests/test_XX.py— minimum 10 sample words - Open a Pull Request with: language name, script, phoneme inventory size
If you are a native speaker wanting to contribute phoneme rules or pronunciation data, open an Issue — all contributions welcome.
| Version | Target |
|---|---|
| v0.1 | Hindi + Punjabi + Bengali |
| v1.0 | Full schwa deletion, tone handling, espeak fallback |
| v1.1 | Tamil + Telugu (Dravidian) |
| v2.0 | All 22 scheduled Indian languages |
| v2.1 | Seq2seq fallback model for OOV words |
| v3.0 | BERT-based homograph disambiguation |
@misc{bind2025indicvoice,
title = {IndicVoice: Decoder-Only Neural TTS with Native G2P for Indian Languages},
author = {Kushal Kant Bind},
year = {2025},
institution = {Chandigarh University},
url = {https://github.com/Bindkushal/indic-voice}
}- IndicVoice TTS → github.com/Bindkushal/indic-voice
- Model on HuggingFace → huggingface.co/Bindkushal/indic-voice
- Kokoro TTS (architecture base) → github.com/hexgrad/kokoro
- Misaki G2P (inspiration) → github.com/hexgrad/misaki