Sayso
a compact English G2P model for Kokoro-82M
2 min readupdated
This model handles grapheme-to-phoneme conversion (G2P — turning written words into phonetic transcriptions) for out-of-vocabulary English words like proper names, tool names, and industry jargon. It outputs phoneme sequences in the misaki library format, ready to feed directly into the popular Kokoro-82M TTS (text-to-speech) model. Built on a lightweight encoder-decoder transformer architecture (5.59M parameters) by rednaSander for the Papegai app, Sayso supports both American and British English. Compared to the classic espeak-ng, it predicts pronunciations for unfamiliar words far more accurately while dropping heavy external dependencies.
Key features
- Dual-accent support: switch between American (
) and British () English using a single start token. - Compact ONNX format: just 5.59M parameters, split into
g2p-encoder.onnxandg2p-decoder.onnxfor fast inference without PyTorch. - Direct compatibility with
misakiand Kokoro-82M with no extra phoneme conversion required. - Apache-2.0 license, trained on the open misaki 0.9.4 lexicons.
What you can do
- Replace
espeak-ngin a Kokoro-82M TTS pipeline to accurately pronounce rare terms, usernames, and brand names. - Embed it into local text readers, voice assistants, or browser extensions where a tiny footprint and
onnxruntimeexecution are essential.
Example
import json, numpy as np, onnxruntime as ort
v = json.load(open("g2p-vocab.json", encoding="utf-8"))
src_id = {c: i for i, c in enumerate(v["src"])}
enc = ort.InferenceSession("g2p-encoder.onnx")
dec = ort.InferenceSession("g2p-decoder.onnx")
ids = [src_id[""]] + [src_id[c] for c in "casanovo"]
mem = enc.run(["mem"], {"src": np.array([ids], dtype=np.int64)})[0]
# далее жадное декодирование в dec до токена -> kˌɑsənˈOvO
Read more
DetailsHeld-out accuracy: 78.0% for US (vs. 28.1% for espeak-ng) and 80.2% for UK (vs. 72.1% for espeak-ng), with phoneme error rates of 4.6% and 4.5%.
Architecture: transformer (width 256, 3+3 layers, 4 heads), trained on ~356,000 word pairs in 34 minutes on a single RTX 5090.
Limitations: word length up to 31 characters (only letters a-z and apostrophes), processes single words only — compound words, numbers, and abbreviations must be split beforehand.










Comments