Skip to main content

A multilingual phonemizer combining lexica, NLP, and probabilistic scoring for improved phonemization accuracy..

Project description

OLaPh — Optimal Language Phonemizer

PyPI version Python versions License: MIT

OLaPh (Optimal Language Phonemizer) is a multilingual phonemization framework that converts text into phonemes surpassing the quality of comparable frameworks.


Overview

Traditional phonemizers rely on simple rule-based mappings or lexicon lookups. Neural and hybrid approaches improve generalization but still struggle with:

  • Names and foreign words
  • Abbreviations and acronyms
  • Loanwords and compounds
  • Ambiguous homographs

OLaPh tackles these challenges by combining:

  • Extensive language-specific dictionaries
  • Abbreviation, number, and letter normalization
  • Compound resolution with probabilistic scoring
  • Cross-language handling
  • NLP-based preprocessing via spaCy and Lingua

Evaluations in German and English show improved accuracy and robustness over existing phonemizers, including on challenging multilingual datasets.


Features

  • Multilingual phonemization (DE, EN-US, EN-UK, FR, ES, NL, SV, DA, PL, IT, FI)
  • Abbreviation and letter pronunciation dictionaries
  • Number normalization
  • Cross-language acronym detection
  • Compound splitting with probabilistic scoring
  • Freely available lexica for research and development derived from wiktionary.org.

Large Language Model

A LLM based on OLaPh output is also available. It is a GemmaX 2B Model trained on ~10M sentences derived from the FineWeb Corpus phonemized with the OLaPh framework.

Find it here on huggingface (Needs to be updated for the additional languages)


Installation

From PyPI

pip install olaph

spaCy models are downloaded on demand.

From source

git clone https://github.com/iisys-hof/olaph.git
cd olaph
pip install -e .

Example Usage

from olaph import Olaph

phonemizer = Olaph()

output = phonemizer.phonemize_text("He ordered a Brezel and a beer in a tavern near München.", lang="en-us")

print(output)

Dependencies


Dictionars Sources

Research Summary

Phonemization, the conversion of text into phonemes, is a key step in text-to-speech. Traditional approaches use rule-based transformations and lexicon lookups, while more advanced methods apply preprocessing techniques or neural networks for improved accuracy on out-of-domain vocabulary. However, all systems struggle with names, loanwords, abbreviations, and homographs. This work presents OLaPh (Optimal Language Phonemizer), a framework that combines large lexica, multiple NLP techniques, and compound resolution with a probabilistic scoring function. Evaluations in German and English show improved accuracy over previous approaches, including on a challenging dataset. To further address unresolved cases, we train a large language model on OLaPh-generated data, which achieves even stronger generalization and performance. Together, the framework and LLM improve phonemization consistency and provide a freely available resource for future research.


Citation

If you use OLaPh in academic work, please cite:

@misc{wirth2025olaphoptimallanguagephonemizer,
      title={OLaPh: Optimal Language Phonemizer},
      author={Johannes Wirth},
      year={2025},
      eprint={2509.20086},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2509.20086},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

olaph-0.2.5.tar.gz (42.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

olaph-0.2.5-py3-none-any.whl (42.7 MB view details)

Uploaded Python 3

File details

Details for the file olaph-0.2.5.tar.gz.

File metadata

  • Download URL: olaph-0.2.5.tar.gz
  • Upload date:
  • Size: 42.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for olaph-0.2.5.tar.gz
Algorithm Hash digest
SHA256 bec48903f9f926ccb79d45d6162138752e483557d00e609ea510d415753d79ec
MD5 e82bcd1d5b9ca55b13bb12b5baa489b7
BLAKE2b-256 01db06ea0ac9aa6cd0c810881f883bd8f4b7a6cf418b7b0d15b2c6857c80a013

See more details on using hashes here.

File details

Details for the file olaph-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: olaph-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 42.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for olaph-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 65bfa0ddbb8d29acba0a9e05aafe1e462343f0500b60cc4a2ac58d8647d47616
MD5 a17ef050665fce521fe25c481944dd94
BLAKE2b-256 a9d5787d47075eab2fab8b61a2834bac241d604d7b6b41764bd60500a09ca934

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page