Grapheme-to-phoneme conversion

Also known as: G2P

On this page 7

Grapheme-to-phoneme conversion (G2P) is the task of predicting the pronunciation of a written word as a sequence of phonemes, the abstract sound units of a language. In Speech & language AI, G2P sits at the front of text-to-speech pipelines and supplies pronunciations to speech recognition lexicons, so any error it makes becomes an audible mispronunciation or a missed word.

The difficulty depends on the orthographic depth of a language. Finnish and Spanish spell almost as they sound, while English, French and Danish have many irregular spellings, silent letters and borrowed words. A single English letter sequence such as “ough” maps to at least five different sounds, which is why purely rule-based conversion fails for English and why modern systems combine dictionaries with learned models.

How grapheme-to-phoneme conversion works

A G2P system takes a normalized word as input and outputs a phoneme string, usually in an inventory such as the International Phonetic Alphabet (IPA) or a machine-friendly set such as ARPAbet for American English. Input normally arrives after text normalization, which has already expanded numbers, abbreviations and symbols into ordinary words.

Production systems rarely rely on one method. The typical design is a lexicon-first cascade: the word is looked up in a curated pronunciation dictionary, and only out-of-vocabulary words such as new names, brands, typos and rare compounds are passed to a statistical or neural model. The following table shows the main stages and what each one contributes.

StageInputOutputMain purpose
Text normalizationRaw text with digits and symbolsSpoken-form wordsRemove non-word tokens
Lexicon lookupNormalized wordKnown pronunciationExact answers for common words
Homograph resolutionWord plus sentence contextSelected variantChoose between spellings with several readings
Model predictionUnknown wordPredicted phonemesCover out-of-vocabulary words
Post-lexical rulesPhonemes in sequenceConnected-speech formApply reduction, linking and stress shifts
Stages of a typical G2P pipeline

Stress and syllable boundaries are often predicted together with the phonemes, because lexical stress changes vowel quality in English and is essential for natural prosody later in the pipeline.

Approaches and model families

G2P methods have evolved from hand-written rewrite rules through joint-sequence models to neural sequence-to-sequence models. Each family still has a role, because accuracy, data needs and controllability differ sharply between them.

ApproachTraining dataStrengthsWeaknesses
Rule-based systemsNone, expert-written rulesTransparent, predictablePoor coverage of irregular spellings
Joint-sequence modelsAligned dictionary entriesRobust with small lexiconsLimited context window
WFST-based modelsAligned dictionary entriesFast, easy to combine with rulesFeature engineering required
Neural seq2seq modelsTens of thousands of entriesHighest accuracy on irregular wordsCan hallucinate implausible output
Multilingual neural modelsLexicons from many languagesTransfer to low-resource languagesQuality varies by script
Main G2P model families compared

Joint-sequence models learn graphones, paired units of letters and phonemes, from aligned dictionaries and decode them with an n-gram model. Neural approaches use encoder-decoder transformers or recurrent networks that read the whole spelling and generate phonemes one at a time, which captures long-range spelling cues such as the silent final “e” in English.

Some recent end-to-end speech synthesis models skip explicit G2P and learn pronunciation from characters directly. In practice, most commercial systems still keep an explicit phoneme layer, because it allows engineers to correct pronunciations without retraining the acoustic model.

Measuring G2P accuracy

G2P quality is measured mainly with word error rate, the share of words whose predicted pronunciation differs from the reference in any phoneme, and phoneme error rate, the edit distance between predicted and reference phoneme strings divided by reference length. Both are computed on a held-out portion of the lexicon, which must not share words with the training set.

MetricWhat it countsTypical use
Word error rateWords with at least one wrong phonemeHeadline comparison of systems
Phoneme error rateInsertions, deletions and substitutionsFine-grained error analysis
Stress accuracyCorrectly placed primary stressProsody-sensitive synthesis
Listening testsErrors judged audible by peopleFinal product validation
Common G2P evaluation metrics

Reported English word error rates for strong neural models on standard dictionaries usually fall in the low twenty percent range or below, depending on the lexicon and whether stress is scored. Shallow orthographies reach near-perfect accuracy with simple rules. Numbers are only comparable when the same lexicon, split and phoneme set are used, because dictionaries disagree on many entries.

G2P is a component technology rather than an end product. It feeds text-to-speech, where it determines what the neural vocoder eventually pronounces, and it expands speech-to-text lexicons so that an acoustic model can recognize words it never saw in training transcripts.

  • Text normalization runs before G2P and decides which words exist; G2P then decides how they sound.
  • Prosody prediction runs after G2P and uses its stress and syllable marks to shape pitch and timing.
  • SSML lets authors bypass G2P with explicit phoneme tags for names and technical terms.
  • Phoneme-to-grapheme conversion is the inverse task, used for spelling unknown spoken words in recognition output.

Limitations and common failure modes

Most G2P errors cluster around a few predictable categories. Knowing them helps teams decide where manual lexicon entries pay off and where a model is good enough.

FailureExampleCauseRemedy
Homographs“read”, “lead”, “wind”Spelling ignores tense or meaningContext-aware disambiguation
Proper namesSurnames, placesOrigin-specific spelling rulesCustom lexicon entries
Loanwords“genre”, “chorizo”Source-language pronunciationLanguage-origin tagging
Acronyms“NASA” versus “FBI”Read as word or letter by letterNormalization rules and lists
Dialect mismatch“tomato”, “schedule”Lexicon built for another accentAccent-specific lexicons
Typical G2P errors and remedies

A frequent mistake is to treat a single dictionary as ground truth. Pronunciations vary by accent and speaking style, and a model trained on one variety will sound wrong to listeners of another. Another risk is silent regression: retraining a neural G2P model can fix rare words while breaking common ones, so teams should freeze high-frequency entries in the lexicon.

Put simply

Grapheme-to-phoneme conversion is how a computer works out how a written word should sound. Letters do not always tell you the sound. In English, “through”, “tough” and “though” look similar but rhyme with nothing in common.

A G2P system works like a careful reader with a pronunciation dictionary. It first checks the dictionary, and when a word is missing, it makes an educated guess based on spelling patterns it has learned. The result is a list of speech sounds that a talking app can actually say. Good G2P is why a voice assistant says names correctly.

In practice

A navigation app team prepares a new voice for a country with thousands of regional place names absent from its standard dictionary. Early test drives reveal that the synthetic voice mispronounces roughly one street name in eight, which drivers find distracting and sometimes confusing.

The team extracts every street and town name from the map database, runs them through a neural G2P model, and sends the 2,000 lowest-confidence predictions to a linguist for review. Corrected entries go into a custom lexicon that the speech engine checks before the model. After the update, listening tests on a random sample show that audible mispronunciations drop sharply, and drivers stop reporting street names as wrong.