g2p-en
A Simple Python Module for English Grapheme To Phoneme Conversion
What it is and what it does
g2p_en is a Python module that converts English text to phoneme sequences, a critical preprocessing step for speech synthesis and text-to-speech systems. It handles the irregularity of English pronunciation by combining three strategies: dictionary lookup via the CMU Pronouncing Dictionary, part-of-speech-based disambiguation for homographs (words with multiple pronunciations), and neural sequence-to-sequence prediction for out-of-vocabulary words. The module also normalizes numbers and abbreviations into spelled-out forms before conversion.
The package depends on numpy for inference (TensorFlow was removed to avoid GPU requirements and API churn), nltk for part-of-speech tagging and dictionary access, inflect for morphological operations, and distance for string matching. It is designed for Python 3.x and installs as a pure wheel with low friction. However, the project has been abandoned since late 2019, with no maintenance or updates since early 2023, so users should be prepared to handle any compatibility issues with modern dependency versions independently.
Use it for:
- Preprocessing text for text-to-speech (TTS) systems where accurate phoneme sequences are required for synthesis quality.
- Building speech recognition training data pipelines that need ground-truth phoneme alignments from orthographic text.
- Linguistic analysis of English pronunciation patterns, homograph disambiguation, and out-of-vocabulary word handling.
- Augmenting speech datasets with phonetic transcriptions for acoustic model training.
- Educational tools that teach English pronunciation by mapping written words to their phonetic representations.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts English text to phoneme sequences using dictionary lookup, part-of-speech disambiguation, and neural prediction for out-of-vocabulary words.
Yes, if you need English grapheme-to-phoneme conversion and can tolerate an abandoned package. The module is stable, has no known vulnerabilities, and works well for its narrow purpose. Install it only if you are comfortable maintaining compatibility with its dependencies yourself and do not expect upstream fixes or feature updates. For active projects requiring long-term support, consider whether a maintained alternative exists.
Install
g2p-en on PyPI
pip
pip install g2p-enuv
uv add g2p-enpoetry
poetry add g2p-enInstalling g2p-en
Before you install
Low install friction with a pure-Python wheel and four straightforward dependencies. However, the package is abandoned—last release was 2019-12-31 and last commit 2023-01-05—so expect no maintenance, bug fixes, or updates to handle modern dependency versions.
License in practice
Apache Software License (permissive) allows free use, modification, and distribution with minimal restrictions, making it safe to integrate into most projects without licensing concerns.
Quickstart
pip install g2p_en
from g2p_en import G2p
g2p = G2p()
output = g2p("I have $250 in my pocket.")
print(output)
nltk data files (averaged_perceptron_tagger, cmudict) are downloaded automatically on first run; no explicit setup required but network access is needed during initialization.
Verify before relying
- Whether the package's neural model remains accurate for modern English or newly coined words beyond its training data.
- Compatibility with current versions of numpy, nltk, inflect, and distance given the package's abandoned status.
- Performance characteristics (latency, memory) for batch processing or real-time speech synthesis pipelines.
Package facts
| License | Apache Software License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — numpy, nltk, inflect, distance |
| Maintenance | abandoned — 2,418 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,134,313/month — #4,313 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: g2p_en-2.1.0-py3-none-any.whl
Keywords: g2p, g2p_en, g2pE
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
misakiConverts written text to phonetic…
permissive · top 15,000 on PyPI
orthography2ipaConverts spelling to IPA phonetic transcription…
permissive · top 15,000 on PyPI
sea-g2pConverts text to phonemes for Vietnamese, Thai,…
permissive · top 15,000 on PyPI
pronouncingProvides a simple Python interface to query the…
permissive · top 15,000 on PyPI
g2pkkg2pkk converts Korean text to phonetic…
permissive · top 15,000 on PyPI
pyopenjtalkWraps OpenJTalk to provide Japanese…
permissive · top 15,000 on PyPI
phonemizerPhonemizer converts written text into phonetic…
copyleft · top 15,000 on PyPI
phonemizer-forkConverts text to phonetic representations…
copyleft · top 5,000 on PyPI
ko-speech-toolsProvides Korean language processing tools…
permissive · top 15,000 on PyPI
gruut-lang-enProvides English language data files for…
permissive · top 15,000 on PyPI