Skip to main content

OpenPhonemizer

Audio Samples / Models / Live Demo / Dataset

A permissively licensed, open sourced, local IPA Phonemizer (G2P) powered by deep learning. This Phonemizer attempts to replicate the espeak Phonemizer while remaining permissively-licensed.

OpenPhonemizer is heavily based on the amazing DeepPhonemizer. The main changes are the model checkpoints, which more closely resembles espeak's phonemizer.

Optional GPL-licensed portions are available here.

Features

  • Permissively licensed & open source
  • Fast & efficient
  • Works well with TTS models that depend on phonemizer or espeak
  • Automatic GPU acceleration (CUDA/MPS) if available

Project

  • Project status: Alpha
  • Supported languages: English (more coming soon! What languages do you want? Let me know!)

Installation

Easily install OpenPhonemizer:

pip install -U openphonemizer

Or, install the latest version from Git:

pip install -U "openphonemizer @ git+https://github.com/NeuralVox/OpenPhonemizer"

Usage

OpenPhonemizer

from openphonemizer import OpenPhonemizer
phonemizer = OpenPhonemizer()
# Or specify a custom checkpoint path: OpenPhonemizer('model.pt')
phonemizer('test')
phonemizer('hello this is a test')

Please note that by default, OpenPhonemizer loads a built-in dictionary of words/phonemes. Because storage is quite inefficient, the model is ~100MB larger and uses more memory, however it is much faster. If you're low on VRAM, you can either run the model exclusively on CPU (disable_gpu=True) or load a model without a dictionary.

Load without dictionary:

from cached_path import cached_path
from openphonemizer import OpenPhonemizer
phonemizer = OpenPhonemizer(str(cached_path('hf://openphonemizer/ckpt/best_model_no_optim.pt'))) # add disable_gpu=True to run on CPU only
phonemizer('test')
phonemizer('hello this is a test')

[NEW] Use autoregressive model:

NEW: An autoregressive model is now available. The autoregressive model is more accurate but slightly slower. To use the autoregressive model:

OpenPhonemizer(str(cached_path('hf://openphonemizer/autoreg-ckpt/best_model.pt')))

Evaluation

We introduce PhonemizerBench, a benchmark to evaluate the similarity of alternate Phonemizers to espeak (this benchmark measures against espeak, assuming it's score is 100).

Run 1

Phonemizer Score
Gruut 75.08
DeepPhonemizer 85.24
G2P_EN 86.16
OpenPhonemizer 93.64
OpenPhonemizer Autoregressive 93.74

Run 2

Phonemizer Score
Gruut 75.54
DeepPhonemizer 85.03
G2P_EN 86.28
OpenPhonemizer 93.54
OpenPhonemizer Autoregressive 93.59

Run 3

Phonemizer Score
Gruut 73.72
DeepPhonemizer 84.64
G2P_EN 85.74
OpenPhonemizer 93.38
OpenPhonemizer Autoregressive 93.67

Todo

  • Train autoregressive model
  • Allow disabling GPU usage
  • Multilingual support (any requests?)

License

OpenPhonemizer is open source software. You may use it under the BSD-3-Clause Clear license found in the LICENSE file.

Please note that OpenPhonemizer depends on software under different licenses, it is your responsibility when redistributing or modifying OpenPhonemizer to comply with these licenses (notably LGPL).

By contributing to this repository, you grant the author the permission to change the license in the future at their sole discretion or offer different licenses to other individuals.

NOTE: Model weights may be licensed under different licenses. Please make sure to check all model weights for licenses.

Credits

Special thanks to Christian Schäfer, who created Deep Phonemizer, on which OpenPhonemizer relies. OpenPhonemizer uses num2words to read out large numbers and cached_path from Allen AI for caching models.

OpenPhonemizer was created by mrfakename.

Metadata

Release files for openphonemizer 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openphonemizer 0.1.2
File Size Uploaded Provenance
openphonemizer-0.1.2.tar.gz 4.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for openphonemizer 0.1.2
File Interpreter ABI Platform
openphonemizer-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / openphonemizer-0.1.2.tar.gz

Download URL openphonemizer-0.1.2.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4df8e2512c9bd39d8efdf2bdb651d95209b1dfb8a9e4b589a6e5c5a9e736c5e5
BLAKE2b-256 checksum
How to use checksums
fcd6daa9534f5cc41eb7ad6f60d1ecda351cda09381287e4c632831aa0f0a7c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release files / openphonemizer-0.1.2-py3-none-any.whl

Download URL openphonemizer-0.1.2-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3876cf6ad76c6c9b0aeb69cb7e24da10dad8240076a0ab04f096d3d6266e3a3a
BLAKE2b-256 checksum
How to use checksums
1fa28ce340b16426d7b62092db1d5dc3a9c050c64d88b1836901b8ee0024d440
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Security for openphonemizer 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page