Pashto Conformer G2P

The first open-source G2P model for Pakistani Pashto

A lightweight Conformer CTC grapheme-to-phoneme model for converting Pakistani Pashto text into broad IPA-style phoneme strings.

Repository: TBOGamer22/nemo-pashto-g2p-conformer


Overview

Pashto Conformer G2P is a character-level grapheme-to-phoneme model trained for Pakistani Pashto speech technology. It converts Pashto-script text into broad IPA-style phoneme strings and is designed for TTS preprocessing, phoneme-label generation, and pronunciation-quality auditing.

To the best of our knowledge, this is the first open-source G2P model specifically released for Pakistani Pashto, including local Pakistani Pashto writing patterns commonly seen in real-world speech datasets and TTS pipelines.

This repository is intended to be the first model in a broader multilingual G2P collection. Future language models can follow the same structure: one portable NeMo artifact, local tokenizers, a small inference script, and a clear evaluation summary.


Highlights

Feature Details
Language Pakistani Pashto
Task Grapheme-to-phoneme conversion
Output Broad IPA-style phoneme strings
Architecture Conformer CTC
Framework NVIDIA NeMo
Repository TBOGamer22/nemo-pashto-g2p-conformer
Main use case Pashto TTS data preparation
Author Talha Bin Omar
License MIT

Quick Start

Install dependencies in an environment with PyTorch and NVIDIA NeMo:

Quick Start

Install dependencies in an environment with PyTorch and NVIDIA NeMo:

pip install -r requirements.txt

Run inference:

python inference.py --text "دا یو مثال دی"

Run inference with JSON output:

python inference.py --text "که موږ غواړو چې د پښتو ژبې لپاره يو قوي او باوري ټکنالوژيکي نظام جوړ کړو، نو اړينه ده چې د متن، غږ او تلفظ تر منځ اړيکې په ډېر دقت سره وڅېړو." --json

Example JSON output:

{
  "text": "که موږ غواړو چې د پښتو ژبې لپاره يو قوي او باوري ټکنالوژيکي نظام جوړ کړو، نو اړينه ده چې د متن، غږ او تلفظ تر منځ اړيکې په ډېر دقت سره وڅېړو.",
  "phonemes": "ka muŋ gwɑɽu t͡ʃe də paxto ʒəbe ləpɑra jəw qawi aw bɑwri ʈaknɑlod͡ʒiki nizɑm d͡ʒoɽ kɽu no aɽina da t͡ʃe də matan ɣag aw talafuz tar mand͡z aɽike pə ɖer daxt sara wat͡seɽo"
}

Batch inference from a text file with one Pashto sentence per line:

python inference.py --text-file inputs.txt --batch-size 32

The script automatically uses CUDA when available. To force CPU:

python inference.py --text "دا یو مثال دی" --device cpu

Model Files

File Purpose
pashto_conformer_g2p.nemo Main packaged NeMo model artifact
model_config.yaml Portable architecture/config file with local tokenizer paths
tokenizers/ Character vocabularies for Pashto graphemes and IPA phonemes
inference.py Self-contained local inference script
training_artifacts/pashto-conformer-g2p-epoch=10-val_per=0.0847.ckpt Optional training checkpoint artifact

Intended Use

This model is intended for:

  • Pakistani Pashto text-to-phoneme generation
  • Pashto TTS preprocessing
  • G2P label bootstrapping
  • Dataset quality auditing
  • Pronunciation consistency checks
  • Low-resource Pashto speech technology research

This model is not intended to be:

  • A general Pashto language model
  • An ASR model
  • A translation model
  • A dialect classifier
  • A narrow phonetic transcription system

Architecture

Component Value
Framework NVIDIA NeMo
Model family Conformer CTC G2P
Input Pakistani Pashto-script graphemes
Output Broad IPA phoneme string
Encoder layers 8
Model dimension 192
Attention heads 4
Convolution kernel size 15
Source repeat for CTC 2
Maximum repeated source length 768

Training Data

The model was trained on a Human-Validated Pashto TTS G2P Dataset.

Split / Metric Count
Valid examples 40,296
Train examples 39,089
Validation examples 805
Test examples 402
Skipped rows during preparation 40

The labels were cleaned through language filtering, G2P disagreement checks, and Gemini + human-assisted validation for suspicious rows.


Evaluation

Internal Validation

The selected checkpoint is:

pashto-conformer-g2p-epoch=10-val_per=0.0847.ckpt
Metric Value
Validation PER 0.0847

PLDST External Audit

An additional external audit was run on a 5,000-row sample from the first four speakers of PLDST.

For this audit, Gemini generated IPA-style reference labels from audio plus Pashto text, while this model predicted phonemes from Pashto text only.

Metric Value
Evaluated rows 4,749
Weighted PER 0.0421
Mean row PER 0.0583
Median row PER 0.0485
P95 row PER 0.1427

Per-speaker weighted PER:

Speaker Rows Weighted PER
S1 - Laiba 1,230 0.0389
S2 - Saqlain 8 0.0450
S3 - Kiran 1,605 0.0438
S4 - Muanazza 1,906 0.0429

The external audit is intentionally conservative because the reference labels were generated from audio-plus-text and may include pronunciation, dialect, recording, or Gemini-labeling effects that are not always recoverable from text alone.


Why This Model Matters

Pakistani Pashto is underrepresented in open-source speech technology. Many existing tools either do not support Pashto well or do not target the writing patterns found in Pakistani Pashto speech datasets.

This model provides a practical open-source baseline for:

  • Building Pashto TTS systems
  • Creating phoneme-based speech datasets
  • Auditing Pashto pronunciation labels
  • Supporting future Pashto ASR, TTS, and speech-to-speech systems

Limitations

  • Outputs are broad IPA-style phoneme strings, not narrow phonetic transcriptions.
  • The model may struggle with code-switching, names, abbreviations, numbers, punctuation-heavy text, and rare spellings.
  • Pashto dialect variation is not fully captured.
  • The model predicts from text only; it does not use audio during inference.
  • Some labels were LLM-assisted and should be treated as high-quality practical labels, not a gold linguistic standard.

Ethical and Practical Notes

This model is intended for speech technology, dataset preparation, and linguistic tooling.

For production TTS, ASR, or research use, outputs should be reviewed carefully, especially for:

  • Difficult names
  • Dialectal words
  • Code-switched utterances
  • Noisy or non-standard spellings
  • High-stakes linguistic claims

Author

Developed and released by:

Talha Bin Omar


Citation

If you use this model, please cite it as:

@misc{binomar2026pashto_conformer_g2p,
  title        = {Pashto Conformer G2P: An Open-Source Grapheme-to-Phoneme Model for Pakistani Pashto},
  author       = {Bin Omar, Talha},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/TBOGamer22/nemo-pashto-g2p-conformer}},
  note         = {Conformer CTC G2P model for broad IPA phoneme generation}
}

License

This model is released under the MIT License.

Copyright (c) 2026 Talha Bin Omar
Downloads last month
63
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for TBOGamer22/nemo-pashto-g2p-conformer

Finetuned
(6)
this model