Datasets:
Add Turkish Text Normalization (TN/ITN) dataset: 17k rule-based pairs + reproducible pipeline, validation, dataset card
5c0e24f verified |
Download README.md from yagmurtuncer/turkish-text-normalization: direct link, hf CLI and curl.
- Browser
- Download file 5.02 kB
-
https://huggingface.co/datasets/yagmurtuncer/turkish-text-normalization/resolve/5c0e24f74eda3df2203d0327594fe8c93c3e9e0e/README.md
- Command line
-
hf download hf://datasets/yagmurtuncer/turkish-text-normalization@5c0e24f74eda3df2203d0327594fe8c93c3e9e0e/README.md
-
curl -L -o README.md https://huggingface.co/datasets/yagmurtuncer/turkish-text-normalization/resolve/5c0e24f74eda3df2203d0327594fe8c93c3e9e0e/README.md
5.02 kB
| language: | |
| - tr | |
| license: cc-by-4.0 | |
| task_categories: | |
| - text2text-generation | |
| - text-generation | |
| tags: | |
| - turkish | |
| - text-normalization | |
| - inverse-text-normalization | |
| - itn | |
| - tts | |
| - asr-post-processing | |
| - numbers | |
| - dates | |
| - synthetic-data | |
| - rule-based | |
| pretty_name: Turkish Text Normalization (TN/ITN) | |
| size_categories: | |
| - 10K<n<100K | |
| configs: | |
| - config_name: default | |
| data_files: | |
| - split: train | |
| path: data/train.csv | |
| - split: test | |
| path: data/test.csv | |
| # 🇹🇷 Turkish Text Normalization (TN / ITN) | |
| A deterministic, **rule-based** dataset of Turkish **written ↔ spoken** pairs for | |
| **Text Normalization (TN)** and **Inverse Text Normalization (ITN)** — mapping digit/symbol | |
| forms (`1.500 TL`, `%25`, `15.07.2026`) to their fully spoken Turkish words | |
| (`bin beş yüz lira`, `yüzde yirmi beş`, `on beş temmuz iki bin yirmi altı`) and back. | |
| This is a common, high-value preprocessing step for **Turkish ASR post-processing** and | |
| **TTS front-ends**, where numbers, dates, currencies and percentages must be verbalized. | |
| > **Provenance & honesty:** every pair is **generated programmatically** with transparent | |
| > linguistic rules (Turkish cardinal/ordinal number grammar, month names, decimal reading | |
| > conventions). No text is scraped and no private data is used. The full generator is included | |
| > ([`build_dataset.py`](build_dataset.py)) so the dataset is **100% reproducible** from a fixed seed. | |
| --- | |
| ## 📦 Contents | |
| | Split | Rows | | |
| |-------|-----:| | |
| | Train | 15,398 | | |
| | Test | 1,711 | | |
| | **Total** | **17,109** | | |
| ### Fields | |
| | Column | Description | | |
| |--------|-------------| | |
| | `id` | Row index within the split | | |
| | `category` | One of: `cardinal`, `ordinal`, `decimal`, `percentage`, `currency`, `date`, `time` | | |
| | `written` | Digit / symbol form (the "written" surface form) | | |
| | `spoken` | Fully verbalized Turkish words (lowercase) | | |
| ### Category distribution (unique pairs) | |
| | Category | Count | Example (`written` → `spoken`) | | |
| |----------|------:|--------------------------------| | |
| | cardinal | 4,259 | `2026` → `iki bin yirmi altı` | | |
| | decimal | 3,497 | `530,5` → `beş yüz otuz virgül beş` | | |
| | date | 3,082 | `15.07.2026` → `on beş temmuz iki bin yirmi altı` | | |
| | currency | 3,051 | `1500 TL` → `bin beş yüz lira` | | |
| | ordinal | 1,683 | `523.` → `beş yüz yirmi üçüncü` | | |
| | time | 1,101 | `14:30` → `saat on dört buçuk` | | |
| | percentage | 436 | `%25` → `yüzde yirmi beş` | | |
| --- | |
| ## 🚀 Usage | |
| ```python | |
| from datasets import load_dataset | |
| ds = load_dataset("yagmurtuncer/turkish-text-normalization") | |
| # ITN (spoken -> written) or TN (written -> spoken) | |
| ex = ds["train"][0] | |
| print(ex["written"], "→", ex["spoken"]) | |
| ``` | |
| Typical uses: | |
| - Train/evaluate a **seq2seq normalizer** (`written` → `spoken` for TTS, or `spoken` → `written` for ASR) | |
| - Rule-engine **regression tests** for Turkish verbalization | |
| - Data augmentation for Turkish ASR/TTS pipelines | |
| --- | |
| ## 🏗️ How it was built (reproducible) | |
| ```bash | |
| python build_dataset.py # regenerates data/ deterministically (seed = 42) | |
| python validate.py # 6 data-quality checks, all must pass | |
| ``` | |
| The generator implements Turkish number grammar directly: | |
| - **Cardinals** up to the billions (`bin` not `bir bin`, `bir milyon`, correct `yüz`/`bin` scaling) | |
| - **Ordinals** via a vetted last-word suffix map (`dört` → `dördüncü`, `on` → `onuncu`) | |
| - **Dates** with Turkish month names, **times** (incl. `buçuk`), **currency** (TL / $ / € / ₺), | |
| **percentages** (`yüzde …`), and **decimals** (`virgül …`) | |
| ### Conventions | |
| - `spoken` is **lowercased Turkish** (letters + spaces only — enforced by `validate.py`) | |
| - Decimal fractions with a leading zero are read **digit-by-digit** (`0,05` → `sıfır virgül sıfır beş`); | |
| otherwise the fraction is read as a whole number (`3,14` → `üç virgül on dört`) | |
| - Pairs are **globally de-duplicated** on `(written, spoken)` — counts reflect *unique* examples, | |
| not inflated repetitions | |
| --- | |
| ## ✅ Data Quality | |
| `validate.py` enforces: non-empty fields · valid category set · `spoken` charset · | |
| global `(written, spoken)` uniqueness · all categories present · every `written` contains a digit. | |
| All checks pass on the released data. | |
| --- | |
| ## ⚠️ Limitations | |
| - Rule-generated: covers standard verbalizations, not every colloquial reading | |
| (e.g. clock time also has `çeyrek geçe` styles not exhaustively included) | |
| - Small `percentage` count is intentional — whole percentages only span 0–100, and duplicates | |
| are removed rather than padded | |
| - Not a substitute for a full production normalizer; intended for training, testing and prototyping | |
| --- | |
| ## 📄 License & Citation | |
| Released under **CC-BY-4.0**. | |
| ```bibtex | |
| @misc{tuncer_turkish_text_normalization, | |
| title = {Turkish Text Normalization (TN/ITN)}, | |
| author = {Nur Yağmur Tuncer}, | |
| year = {2026}, | |
| url = {https://huggingface.co/datasets/yagmurtuncer/turkish-text-normalization} | |
| } | |
| ``` | |