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.4
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.4.tar.gz | 48.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| indic_itn-0.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 90.0 kB
Release files / indic_itn-0.2.4.tar.gz
| Download URL | indic_itn-0.2.4.tar.gz |
|---|---|
| Size | 48.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d1359ec0c022007bf9c1d8eb4f04747de3bcdb301c8632458e757ba5987214dd
|
|
BLAKE2b-256 checksum How to use checksums |
358e1fcfa79bea8a412b3e8d25582d47b1c8e53b58489fcfc488f2e81be39f68
|
| 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.4-py3-none-any.whl
| Download URL | indic_itn-0.2.4-py3-none-any.whl |
|---|---|
| Size | 41.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5aebba1500e4f49dae170b118ff09c5bc6a0e575bbd21bd5a225a20f33fd5b5f
|
|
BLAKE2b-256 checksum How to use checksums |
5f514bcdc538b700950c15cf56c4d1eaf27e6601c7844f1a2be078297bd17915
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|