T5 IPA-to-Text (Ghanaian English) β v2
Converts a Ghanaian-English IPA phoneme sequence into the English text it represents. Use it to turn phonetic output β from a G2P tool or a phoneme-recognizing ASR model β back into ordinary written English.
Usage
from transformers import AutoTokenizer, T5ForConditionalGeneration
tok = AutoTokenizer.from_pretrained("ghananlpcommunity/ghana-english-ipa2text-tokenizer")
model = T5ForConditionalGeneration.from_pretrained("ghananlpcommunity/t5-small-ipa2text-v2")
ipa = "Ι‘ Κ d m ΙΛ n Ιͺ Ε , l e d i s Γ¦ n d dΚ Ι n t Ι l m Ι n !"
ids = tok(ipa, return_tensors="pt").input_ids
out = model.generate(ids)
print(tok.decode(out[0], skip_special_tokens=True))
# "Good morning, ladies and gentlemen!"
No task prefix β feed the IPA string directly. Use the paired tokenizer
(ghananlpcommunity/ghana-english-ipa2text-tokenizer),
not stock T5-small's β this model's vocabulary was extended with phone tokens it needs.
For a full audio β text pipeline (chaining a phoneme-ASR model in front of this one, with
chunking for long audio), see scripts/infer.py in this repo, or the
poto-asr library.
Training data
ghananlpcommunity/ghana-gov-speeches-sentences-ipa-robust:
Ghana government/parliamentary speech, phonemised with
ghana-english-g2p. Training input isn't clean
G2P output as-is β each batch, most examples are run through one of five random perturbations
(vowel-length collapse, weak-vowel deletion, consonant confusion/deletion, phone insertion) that
mimic real ASR phoneme-recognizer errors, so the model has seen noisy input, not just perfect
phonemes.
Evaluation
Held-out validation, scored with SacreBLEU against the clean reference sentence: 84.94.
Limitations
- Numbers and dates are the least reliable part of the output β many spoken-number phrases are phonetically ambiguous, so rare or unseen numbers can come out wrong.
- Rare proper nouns (names seen once or twice in training) are less reliable than common vocabulary.
- Domain: trained entirely on formal government/parliamentary speech. Expect the best accuracy on similar formal register; casual conversation is out of domain.
- Real (ASR-produced) input can occasionally trigger a repetition loop under decoding; this
model's
generation_config.jsonalready setsno_repeat_ngram_size=3andrepetition_penalty=1.3to guard against it β don't override those unless you've checked the effect on your inputs.
Model Author
Mich-Seth Owusu
- Downloads last month
- 31
Model tree for ghananlpcommunity/t5-small-ipa2text-v2
Base model
google-t5/t5-small