Repository navigation
Releases
Releases · proairface/KotlinG2P
v0.8.0
v0.7.0
Merge pull request #5 from proairface/claude/kotling2p-detour-handove…
v0.6.0
Merge pull request #3 from proairface/claude/kotling2p-detour-handove…
v0.5.0
Correct stress with a second forest, using the letter model's own gue…
v0.4.0
Vote across a forest of trees, and fix the published artifact Accuracy: 64.2% to 68.0% of held-out words exactly right, phoneme error rate 9.0% to 7.7%. Nine trees per letter now vote instead of one deciding. Each is trained on its own bootstrap resample and may only choose between ten of the twelve features at any split, so they disagree where the evidence is thin. That disagreement is the point. A single tree grown to pure leaves is certain about everything, which is why beam search over whole words bought nothing when it was tried against one tree and is recorded in the README as a failure. A split vote is a real confidence estimate, and against the ensemble the same search is worth about a point (66.8% greedy, 67.7% with a beam of 8) — so the search is back, for a reason this time. Nine is the knee of the curve, chosen on measured cost rather than the best score: fifteen trees reach 68.9% and twenty-five 69.2%, but heap roughly doubles and quadruples. At nine it is ~5.8 MB of heap, 1.2 MB in the jar, under 200 ms to load and 67 us per unknown word. Node tags are packed into shorts, worth 3 MB of that heap at no cost — a tag never exceeds a few hundred. Also fixes a real packaging regression from the previous commit. Making the trainer a Gradle subproject was meant to keep it out of the published jar and did the opposite: JitPack publishes every module it finds, so com.github.proairface:KotlinG2P:v0.3.0 resolved to an aggregate POM that pulled the trainer into any app depending on the library. It is a source set now, which cannot fail that way, since `jar` packages only `main`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BtiynRL3VisERGpMquRg8x
v0.3.0
Replace the hand-written letter-to-sound rules with a trained model English spelling is too irregular to enumerate by hand, and the rules had hit their ceiling at 15.6% word accuracy. This learns the mapping from CMUdict itself instead: 64.2% of held-out words exactly right, phoneme error rate down from 30.7% to 9.0%. The new `trainer` subproject (not published) does the work in two stages, and writes a 375 KB binary the library ships as a resource: - `Aligner` infers, by expectation-maximization, which phonemes each letter of a word is responsible for — the detail a dictionary never states and every later step needs. All but 25 of 118,714 training entries align. - `TreeTrainer` grows one CART decision tree per letter over that alignment, splitting on the surrounding letters and on the phonemes already emitted to the left. That second group of features is what stops the model dropping the vowel out of a syllable, and is worth ~4 points on its own. Decoding is a pointer chase down one tree per letter: no floating point, no new dependencies, and 3-11 ms to load the whole model. Accuracy claims are kept honest by `TrainingSplit`, which holds out one word in twenty by hashing the word. The trainer excludes exactly those words and `LtsModelBenchmarkTest` scores only those words, both through the same function, so a model trained on the dictionary can never be graded on its own memory. Three ideas that looked right and measured worse are recorded in the README rather than left to be re-attempted: wider letter context, position-in-word features, and beam search over whole words. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BtiynRL3VisERGpMquRg8x
v0.2.0
Add espeak-ng/Piper-compatible IPA output Adds G2P.toEspeakIpa(text), producing the exact phoneme vocabulary and stress-marker placement a Piper-trained voice model expects, without depending on espeak-ng itself. Verified against real espeak-ng output (not assumed): 12/13 test words match exactly, with one documented gap. Along the way, fixes a real bug in ArpabetToIpa -- it mapped stressed ARPAbet ER to "ɝ", a symbol that doesn't exist anywhere in Piper's actual phoneme vocabulary (real espeak-ng output uses "ɜː" instead). Also adds stress-dependent AH handling (ʌ/ə/ɐ) and American-English T-flapping, both confirmed against real espeak-ng output rather than assumed from textbook IPA. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BtiynRL3VisERGpMquRg8x
v0.1.0
CMUdict lookup + letter-to-sound fallback G2P engine