indic-itn (v0.2.1)
Inverse Text Normalization (ITN) for Indic languages (Hindi, Telugu, Kannada, etc.).
indic-itn converts spoken-form ASR (Automatic Speech Recognition) transcriptions into normalized written representations across currency, date, decimal, number, OTP, percentage, phone, and time entities.
Installation
pip install indic-itn
Or install locally in editable mode for development:
pip install -e ".[dev]"
Usage
1. Hindi ITN
from indic_itn import HindiITN
itn = HindiITN()
# Numbers & Currency
print(itn.normalize("पाँच लाख साठ हजार रुपये"))
# Output: "₹560000"
# Time & Date
print(itn.normalize("पाँच बजकर तीस मिनट"))
# Output: "5:30"
2. Telugu ITN
from indic_itn import TeluguITN
itn = TeluguITN()
# Numbers & Currency
print(itn.normalize("రెండు వందల రూపాయలు"))
# Output: "₹200"
# Phone & OTP
print(itn.normalize("నా నంబర్ తొమ్మిది ఎనిమిది ఏడు ఆరు ఐదు నాలుగు మూడు రెండు ఒకటి సున్నా"))
# Output: "నా నంబర్ 9876543210"
3. Kannada ITN
from indic_itn import KannadaITN
itn = KannadaITN()
# Percentage & Decimal
print(itn.normalize("ಮೂರು ಬಿಂದು ಒಂದು ನಾಲ್ಕು"))
# Output: "3.14"
print(itn.normalize("ಇಪ್ಪತ್ತೈದು ಶೇಕಡಾ"))
# Output: "25%"
4. Generic Multi-Lingual Factory (IndicITN)
from indic_itn import IndicITN
# Dynamically instantiate ITN for any supported language code
hi_itn = IndicITN(lang="hi")
te_itn = IndicITN(lang="te")
kn_itn = IndicITN(lang="kn")
ta_itn = IndicITN(lang="ta") # Tamil
5. Checking Supported Languages Programmatically
from indic_itn import IndicITN, get_supported_languages
# Call classmethod on IndicITN
print(IndicITN.get_supported_languages())
# Output: ['hi', 'kn', 'ta', 'te']
# Or call top-level utility function
print(get_supported_languages())
# Output: ['hi', 'kn', 'ta', 'te']
Supported Entity Types
| Entity Type | Example Spoken Input | Normalized Output |
|---|---|---|
| Number | "कक्षा दो" / "తరగతి రెండు" / "ತರಗತಿ ಎರಡು" |
"कक्षा 2" / "తరగతి 2" / "ತರಗತಿ 2" |
| Currency | "दो सौ रुपये" / "రెండు వందల రూపాయలు" / "ಎರಡು ನೂರು ರೂಪಾಯಿ" |
"₹200" |
| Date | "पच्चीस दिसंबर दो हजार पच्चीस" |
"25 दिसंबर 2025" |
| Time | "पाँच बजकर तीस मिनट" / "ఐదు ಗంటల ముప్పై నిమిషాలు" |
"5:30" |
| Decimal | "तौम्मिदि दशमलव पाँच" / "మూడు పాయింట్ ఒకటి నాలుగు" |
"9.5" / "3.14" |
| Percentage | "इरवै आईदु प्रतिशत" / "ಇಪ್ಪತ್ತೈದು ಶೇಕಡಾ" |
"25%" |
| Phone | "मेरा नंबर नौ आठ सात छह पाँच चार तीन दो एक शून्य" |
"मेरा नंबर 9876543210" |
| OTP | "मेरा ओटीपी छह पाँच चार तीन दो एक" |
"मेरा ओटीपी 654321" |
Development and Tooling
Running Tests and Coverage
pytest --cov=indic_itn --cov-report=term-missing
Code Formatting and Linting
ruff check .
ruff format --check .
Release files for indic-itn 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| indic_itn-0.2.2.tar.gz | 45.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| indic_itn-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 84.3 kB
Release files / indic_itn-0.2.2.tar.gz
| Download URL | indic_itn-0.2.2.tar.gz |
|---|---|
| Size | 45.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
212cb5e78e3abe1e7ad8e0d2ab46d6e6349407120e81781bb55df9290b57e426
|
|
BLAKE2b-256 checksum How to use checksums |
69686e3c1f81b4ff260ccb6c555e69d0374d4e9086b1bcebb54bc8687b49146a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|
Release files / indic_itn-0.2.2-py3-none-any.whl
| Download URL | indic_itn-0.2.2-py3-none-any.whl |
|---|---|
| Size | 39.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d10fc4001eab0feb18d099ea3a18eb58f0853d04184730e60f1facd6ca06ebc3
|
|
BLAKE2b-256 checksum How to use checksums |
417fae36378f2d88981b9e640bd4ae30eb5c4a086598d505741c8e8d74a870fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|