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.3
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.3.tar.gz | 47.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| indic_itn-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 88.0 kB
Release files / indic_itn-0.2.3.tar.gz
| Download URL | indic_itn-0.2.3.tar.gz |
|---|---|
| Size | 47.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8aeb1d1b34a25b6ccd33b00135410e75788926eb9c62d7de46e54c8409aa43fc
|
|
BLAKE2b-256 checksum How to use checksums |
73dcd5b7c38a786ec3be190e98e2a03c1be3eaa48658a74c94bfc833e568e3fc
|
| 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.3-py3-none-any.whl
| Download URL | indic_itn-0.2.3-py3-none-any.whl |
|---|---|
| Size | 40.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e28a0544743fc0303797cd4dd023b5a20d7730e9c25d26de290410a99ad74e3
|
|
BLAKE2b-256 checksum How to use checksums |
9ec4822d66c170a5bdc63be852c0d9caf1dc9dc0dc67b4c377f4a290c432af0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|