Phoneme model (IPA) for 85 languages from FLEURS.
import os
import torch
from datasets import load_dataset
from transformers import AutoProcessor, AutoModelForCTC
MODEL = "mahesh27/mms-300m-ipa-fleurs"
LANG = "de_de"
# 1. Load model and German adapter
processor = AutoProcessor.from_pretrained(MODEL)
model = AutoModelForCTC.from_pretrained(MODEL, device_map="auto")
model.load_adapter(LANG)
model.eval()
# 2. Get first German test utterance from Google FLEURS
fleurs_audio = load_dataset(
"google/fleurs",
LANG,
split="test",
streaming=True,
)
sample = next(iter(fleurs_audio))
audio = sample["audio"]["array"]
sample_rate = sample["audio"]["sampling_rate"]
# 3. Load FLEURS-IPA completely and find matching utterance
fleurs_ipa = load_dataset("mahesh27/fleurs-ipa", split="test")
audio_filename = os.path.basename(sample["audio"]["path"])
match = fleurs_ipa.filter(
lambda x: x["audio_file"] == audio_filename and x["id"] == sample["id"]
)[0]
print("\nGold IPA:")
print(match['ipa'])
print("\nGold Word Segmented:")
print(match['word_segmented'])
# 4. Run the audio through the model
inputs = processor(
audio,
sampling_rate=sample_rate,
return_tensors="pt",
)
inputs = {
k: v.to(model.device)
for k, v in inputs.items()
}
with torch.inference_mode():
logits = model(**inputs).logits
pred_ids = torch.argmax(logits, dim=-1)
prediction = processor.batch_decode(pred_ids)[0]
print("\nPrediction:")
print(prediction)
Gold IPA:
fyʁ diː bestən ausixtən auf hoŋkkoŋ soltən siː diː insel feɐlasən und t͡sum ɡeːɡənyːbeɐliːɡəndən uːfeʁ fon kovloːn faːʀən
Gold Word Segmented:
für die besten aussichten auf hongkong sollten sie die insel verlassen und zum gegenüberliegenden ufer von kowloon fahren
Prediction:
fyʁ diː bestən aussixtən auf ʁonkoŋɡ soltən siː diː insel feɐlasən undt͡sum ɡeːɡeːnyːbeɐleːɡəndən uːfeʁ fon koflun faːʀən
Alignments can be performed using ctc-segmentation (following Wav2vec2 example code under 'Usage')
@inproceedings{akavarapu-etal-2026-phoneme,
title = "Phoneme- and Word-Level Metrics Using Self-Supervised Speech Representations for Forced Alignment Evaluation",
author = {Akavarapu, V.S.D.S.Mahesh and
Daniel, Michael and
J{\"a}ger, Gerhard},
editor = "Lee, Hung-Yi and
Dev, Sunipa and
Li, Jessy and
Elliott, Desmond",
booktitle = "Findings of the {A}ssociation for {C}omputational {L}inguistics: {EMNLP} 2026",
month = oct,
year = "2026",
address = "Budapest, Hungary",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2026.findings-emnlp.279/",
pages = "5865--5892",
ISBN = "979-8-89176-462-0",
}
model.safetensors 1.3 GBadapter.cmn_hans_cn.bin 4 MBadapter.yue_hant_hk.bin 4 MBadapter.ast_es.bin 4 MBadapter.ceb_ph.bin 4 MBadapter.ckb_iq.bin 4 MBadapter.es_419.bin 4 MBadapter.af_za.bin 4 MBadapter.am_et.bin 4 MBadapter.ar_eg.bin 4 MBadapter.az_az.bin 4 MBadapter.be_by.bin 4 MBadapter.bg_bg.bin 4 MBadapter.bn_in.bin 4 MBadapter.ca_es.bin 4 MBadapter.cs_cz.bin 4 MBadapter.cy_gb.bin 4 MBadapter.da_dk.bin 4 MBadapter.de_de.bin 4 MBadapter.el_gr.bin 4 MBadapter.en_us.bin 4 MBadapter.et_ee.bin 4 MBadapter.fa_ir.bin 4 MBadapter.ff_sn.bin 4 MBadapter.fi_fi.bin 4 MBadapter.fr_fr.bin 4 MBadapter.ga_ie.bin 4 MBadapter.gl_es.bin 4 MBadapter.ha_ng.bin 4 MBadapter.he_il.bin 4 MBadapter.hi_in.bin 4 MBadapter.hr_hr.bin 4 MBadapter.hu_hu.bin 4 MBadapter.hy_am.bin 4 MBadapter.id_id.bin 4 MBadapter.it_it.bin 4 MBadapter.ja_jp.bin 4 MBadapter.jv_id.bin 4 MBadapter.ka_ge.bin 4 MBadapter.kk_kz.bin 4 MBadapter.km_kh.bin 4 MBadapter.kn_in.bin 4 MBadapter.ko_kr.bin 4 MBadapter.ky_kg.bin 4 MBadapter.lg_ug.bin 4 MBadapter.lo_la.bin 4 MBadapter.lt_lt.bin 4 MBadapter.lv_lv.bin 4 MBadapter.mi_nz.bin 4 MBadapter.mk_mk.bin 4 MBadapter.ml_in.bin 4 MBadapter.mn_mn.bin 4 MBadapter.mr_in.bin 4 MBadapter.ms_my.bin 4 MBadapter.mt_mt.bin 4 MBadapter.my_mm.bin 4 MBadapter.nb_no.bin 4 MBadapter.ne_np.bin 4 MBadapter.nl_nl.bin 4 MBadapter.ny_mw.bin 4 MBadapter.om_et.bin 4 MBadapter.or_in.bin 4 MBadapter.pa_in.bin 4 MBadapter.pl_pl.bin 4 MBadapter.ps_af.bin 4 MBadapter.pt_br.bin 4 MBadapter.ro_ro.bin 4 MBadapter.ru_ru.bin 4 MBadapter.sl_si.bin 4 MBadapter.sn_zw.bin 4 MBadapter.so_so.bin 4 MBadapter.sv_se.bin 4 MBadapter.sw_ke.bin 4 MBadapter.ta_in.bin 4 MBadapter.te_in.bin 4 MBadapter.tg_tj.bin 4 MBadapter.th_th.bin 4 MBadapter.tr_tr.bin 4 MBadapter.uk_ua.bin 4 MBadapter.ur_pk.bin 4 MBadapter.uz_uz.bin 4 MBadapter.vi_vn.bin 4 MBadapter.wo_sn.bin 4 MBadapter.xh_za.bin 4 MBadapter.yo_ng.bin 4 MBadapter.zu_za.bin 4 MBfacebook/mms-300m