G2P for the reading voices (v0.5.0) #8

Merged
mnovak merged 1 commits from feature/g2p into main 2026-11-18 17:30:26 +01:00
Owner

Day 4 read-aloud (v0.5.0): our own G2P for the Piper voices (Mark's decision: Piper + own G2P, Czech, German and English).

The voices were trained on espeak-ng IPA; espeak-ng is GPL, so liber_lang::g2p writes the same conventions itself (stress mark before the stressed vowel, ː, words separated by spaces, . , ? ! ; : kept):

  • cs: digraphs (ch, dž, ou, au, eu, ej), ď ť ň and d/t/n + i/í/ě, bě/pě/vě/fě → je, mě → mɲe, ř / voiceless ř̊, n + k/g → ŋ, regressive voicing assimilation and final devoicing (a one-consonant preposition is left to the next word), syllabic r and l, stress on the first syllable, unstressed clitics. Latin is read with these rules.
  • de: stress (first syllable; after be-/ge-/er-/ver-/zer-/ent-/emp-/miss- in longer words; -ieren, -tion, -erei), vowel length (doubled, silent h, open syllable, single final consonant except short function words, -uch), ə/ɐ in endings, vocalic r, ch → x/ç, sch, st-/sp-, z, doubled consonants, final devoicing, -ig → ɪç, ei/ai, eu/äu, au, ie.
  • en: CMUdict ARPABET → espeak en-us IPA (Lexicon::from_cmudict, capped: hostile input; the app fetches the dictionary), ɜː/ɚ, flapping, secondary stress; letter-to-sound rules for unknown words.
  • num: numbers as words (cs, de, en; years 1100–1999 in en/de).
  • tokens: NFD code points with the voice's vowel clusters merged (aɪ, oʊ …): exactly how Piper 1.5 feeds its models.
  • Lang::Cs added (no lemma rules).

Tests (tests/g2p.rs, 6): Czech 37/37 and German 30/30 on hand-written golds (floors 95% / 90%), English dictionary path and rules, sentences with numbers and punctuation, token splitting (ř, ç, clusters), hostile dictionaries. Workspace 116 green; clippy 0; deps 0 not allowed.

Self-review

  • The golds are mine, written in espeak's conventions; they test that the rules do what was intended, not that the voice sounds right. The listening test is Mark's on the installed build.
  • German rules are approximations: compounds, loanwords and many stress exceptions will be wrong; English unknown words are crude. Both degrade to an understandable reading, not silence.
  • No GPL code was used or copied; Piper's id layout (^ _ p _ … $) was read from its documentation/source only to match the model's input format.
Day 4 read-aloud (v0.5.0): our own G2P for the Piper voices (Mark's decision: Piper + own G2P, Czech, German and English). The voices were trained on espeak-ng IPA; espeak-ng is GPL, so `liber_lang::g2p` writes the same conventions itself (stress mark before the stressed vowel, `ː`, words separated by spaces, `. , ? ! ; :` kept): - `cs`: digraphs (ch, dž, ou, au, eu, ej), ď ť ň and d/t/n + i/í/ě, bě/pě/vě/fě → je, mě → mɲe, ř / voiceless ř̊, n + k/g → ŋ, regressive voicing assimilation and final devoicing (a one-consonant preposition is left to the next word), syllabic r and l, stress on the first syllable, unstressed clitics. Latin is read with these rules. - `de`: stress (first syllable; after be-/ge-/er-/ver-/zer-/ent-/emp-/miss- in longer words; -ieren, -tion, -erei), vowel length (doubled, silent h, open syllable, single final consonant except short function words, -uch), ə/ɐ in endings, vocalic r, ch → x/ç, sch, st-/sp-, z, doubled consonants, final devoicing, -ig → ɪç, ei/ai, eu/äu, au, ie. - `en`: CMUdict ARPABET → espeak en-us IPA (`Lexicon::from_cmudict`, capped: hostile input; the app fetches the dictionary), ɜː/ɚ, flapping, secondary stress; letter-to-sound rules for unknown words. - `num`: numbers as words (cs, de, en; years 1100–1999 in en/de). - `tokens`: NFD code points with the voice's vowel clusters merged (`aɪ`, `oʊ` …): exactly how Piper 1.5 feeds its models. - `Lang::Cs` added (no lemma rules). **Tests** (`tests/g2p.rs`, 6): Czech 37/37 and German 30/30 on hand-written golds (floors 95% / 90%), English dictionary path and rules, sentences with numbers and punctuation, token splitting (ř, ç, clusters), hostile dictionaries. Workspace 116 green; clippy 0; deps 0 not allowed. **Self-review** - The golds are mine, written in espeak's conventions; they test that the rules do what was intended, not that the voice sounds right. The listening test is Mark's on the installed build. - German rules are approximations: compounds, loanwords and many stress exceptions will be wrong; English unknown words are crude. Both degrade to an understandable reading, not silence. - No GPL code was used or copied; Piper's id layout (`^ _ p _ … $`) was read from its documentation/source only to match the model's input format.
mnovak added 1 commit 2026-11-18 17:30:23 +01:00
mnovak merged commit 7be8fca42b into main 2026-11-18 17:30:26 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mnovak/Liber-public#8