svogunas/g2p-lt-byt5-base
g2p-lt-byt5-base — Lithuanian grapheme-to-phoneme (G2P)
A byte-level ByT5 model that converts Lithuanian words in standard orthography into their phoneme sequence. It is the pronunciation front-end for Lithuanian TTS (and useful for forced alignment, lexicon expansion, and linguistic tooling).
- Input: one word, standard Lithuanian spelling, lowercase — e.g.
labas - Output: space-separated phonemes in the LIEPA-3
phonalphabet — e.g.l a b a s - Architecture: `google/byt5-base` (582 M), fully fine-tuned. Byte-level ⇒ no tokenizer issues with Lithuanian letters or phoneme symbols.
This is the flagship (most accurate). A smaller, ~2× faster variant for edge/embedded use is `svogunas/g2p-lt-byt5-small`.
Results
Held-out test set of 3,000 words unseen in training (true generalisation), word-level PER (phoneme error rate) and exact-match word accuracy:
For comparison, the small variant scores 1.98 % / 88.3 %. A larger byt5-large was trained and did not improve over base (2.57–2.70 % PER) — capacity past byt5-base is wasted on this data, so base is the recommended model.
Usage
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tok = AutoTokenizer.from_pretrained("svogunas/g2p-lt-byt5-base")
model = AutoModelForSeq2SeqLM.from_pretrained("svogunas/g2p-lt-byt5-base")
def g2p(word: str) -> str:
ids = tok(word.lower(), return_tensors="pt").input_ids
out = model.generate(ids, max_length=64) # greedy; add num_beams=5 for a tiny gain
return tok.decode(out[0], skip_special_tokens=True)
print(g2p("labas")) # l a b a s
print(g2p("abaravičiene")) # a b a r a v' i tS' ie n' eFeed one word at a time (the model is trained on isolated words). For a sentence, split on whitespace, look words up, and handle punctuation/numbers in your own front-end.
Phoneme notation (LIEPA-3 phon alphabet)
Phonemes are space-separated. Conventions:
- Lowercase base symbols for the core sounds.
- `'` after a consonant marks palatalization (Lithuanian minkštumas):
v',tS',n'. - Doubled symbols mark length:
aa,oo,ii,ee,uu. - Digraphs for diphthongs/affricates:
ie,uo,ea;tS(č),dZ(dž),ts(c),dz. - Capitalised variants encode stress / length distinctions (e.g.
aA,Aa,Oo,Ea).
Full inventory (~90 symbols) observed in the training lexicon:
a i e s s' n' t' t u oo k m r' n r k' l' p j j' m' I v' p' ee d d' l ii S' E v w
g' g uu U aA o S b' tS' b A Aa Ee Uo Z' aa Oo Ii Ea ea ie z J ts' eA z' Z uo O iI
W uU f' dZ' f oO N iE eE N' Uu Ie R' R uO x h L' ts M' x' h' L M tS dZ dz' dzTraining data
- LIEPA-3 word+phoneme TextGrids (
phon/) — the bulk of the lexicon. - EMO (Lithuanian emotional speech) phoneme annotations.
- Merged at the variant level into a 233 k-word pronunciation lexicon, one consistent notation, 99.5 % mean cross-source agreement, dominant variant kept; 3 k words held out for the test above.
- Excluded by design: medical (different SAMPA notation — needs re-extraction) and dialectal (phonetic, not orthographic, transcripts).
Fine-tuned from google/byt5-base, 5 epochs, lr 5e-4, load_best_model_at_end on eval loss.
Limitations
- Isolated-word model: no sentence-level context, sandhi, or homograph disambiguation.
- Trained on standard Lithuanian; dialectal pronunciation is out of scope.
- Stress placement follows the lexicon's conventions; verify against your TTS phoneme set.
License & attribution
Released under CC BY 4.0. Training data (LIEPA-3, EMO) is CC BY 4.0 from VDU / CLARIN-LT — please attribute them when you use this model:
Pronunciation lexicon derived from LIEPA-3 and the VDU Lithuanian emotional speech corpus, distributed via CLARIN-LT (CC BY 4.0).
Citation
@misc{g2p-lt-byt5-base,
title = {g2p-lt-byt5-base: Lithuanian grapheme-to-phoneme (ByT5)},
author = {Smaliukas, Arūnas},
year = {2026},
note = {Fine-tuned from google/byt5-base on a LIEPA-3 + EMO pronunciation lexicon (CC BY 4.0)},
url = {https://huggingface.co/svogunas/g2p-lt-byt5-base}
}