OLaPhLLM is a large language model for phonemization, finetuned from GemmaX2-28-2B-v0.1.
Its tokenizer was extended with phoneme tokens, derived from a BPE tokenizer trained on phoneme sequences generated by the
OLaPh framework).
The model was then finetuned for grapheme-to-phoneme conversion on a multilingual dataset (English, German, French, Spanish), created by phonemizing text from HuggingFaceFW/fineweb and HuggingFaceFW/fineweb-2 using the OLaPh framework as well as with lexicon words taken from OLaPh.
The training set comprised 650,000 sentence pairs per target language (English, French, German, and Spanish), supplemented by 100,000 isolated, randomly selected lexicon entries per language, totaling 3 million training examples.
The reported values are Phone Error Rate (PER) across the
Wikipron dataset.
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3lang = "English" #German, French, Spanish
4sentence = "But we are not sorry, for the rain is delightful."
5
6model_id = "iisys-hof/OLaPhLLM_v2"
7tokenizer = AutoTokenizer.from_pretrained(model_id)
8model = AutoModelForCausalLM.from_pretrained(model_id).to("cuda")
9
10prompt = f"Translate this from {lang} to Phones:\n{lang}: "
11
12inputs = tokenizer(f"{prompt}{sentence}\nPhones:", return_tensors="pt").to("cuda")
13
14outputs = model.generate(**inputs, max_new_tokens=256)
15phonemized = tokenizer.decode(outputs[0], skip_special_tokens=True)
16phonemized = phonemized.split("\n")[-1].replace("Phones:", "")
17
18print(phonemized)
1@misc{wirth2026olaphoptimallanguagephonemizer,
2 title={OLaPh: Optimal Language Phonemizer},
3 author={Johannes Wirth},
4 year={2026},
5 eprint={2509.20086},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2509.20086},
9}