Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ovos-scriptconv-g2p-plugin

An OVOS Plugin Manager (OPM) Grapheme2Phoneme plugin.

This plugin does not phonemize text itself. It is a thin adapter over scriptconv's phonemizer registry, which bundles 45 phonemizer backends behind one API and converts every one of them to IPA on request - including backends that natively emit ARPABET, X-SAMPA, or another notation, since notation conversion is scriptconv's whole reason to exist.

Which backend runs is a matter of config, nothing else. Point phonemizer at any scriptconv.phonemizers.Phonemizer registry name and this plugin uses it. Leave it unset and scriptconv's own per-language LANG_DEFAULTS/fallback chain (explicit default -> orthography2ipa -> espeak) picks a backend per word, same as calling scriptconv.phonemizers.phonemize() directly.

Benchmarked and compared against the other G2P plugins in the ovos-plugin-arena.

Install

pip install ovos-scriptconv-g2p-plugin

scriptconv and ovos-plugin-manager are the only hard dependencies. Individual phonemizer backends are optional - scriptconv lazy-imports them, and installing this plugin does not pull in any of the 45 backing packages. If you configure a backend whose package isn't installed, you get a clear ImportError naming the pip extra to install, e.g.:

pip install scriptconv[espeak]        # espeak backend
pip install scriptconv[o2i]           # orthography2ipa backend
pip install scriptconv[pt-phonemizers]  # tugaphone backend

See scriptconv's pyproject.toml for the full extras list - one per backend or language family.

Configuration

"g2p": {
    "module": "ovos-scriptconv-g2p-plugin",
    "ovos-scriptconv-g2p-plugin": {
        "phonemizer": "espeak",
        "lang": "en-us"
    }
}
  • phonemizer (optional): registry name of the scriptconv phonemizer to use, e.g. "espeak", "orthography2ipa", "tugaphone". Omit it to let scriptconv pick the default backend per language.
  • lang (optional): default language used when a caller doesn't pass one explicitly.
  • any other key is forwarded as a keyword argument to the underlying scriptconv phonemizer constructor (model, normalizer, ...).

Usage

from ovos_plugin_manager.g2p import OVOSG2PFactory

config = {"g2p": {"module": "ovos-scriptconv-g2p-plugin",
                   "ovos-scriptconv-g2p-plugin": {"phonemizer": "espeak"}}}
g2p = OVOSG2PFactory.create(config)
print(g2p.get_ipa("hello", "en-us"))

Links

  • scriptconv - the phonemizer registry and notation converter this plugin wraps
  • ovos-plugin-manager - defines the Grapheme2PhonemePlugin contract this plugin implements
  • ovos-plugin-arena - benchmarks this plugin against other G2P engines

Download files

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

Source Distribution

ovos_scriptconv_g2p_plugin-0.0.1a2.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

ovos_scriptconv_g2p_plugin-0.0.1a2-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file ovos_scriptconv_g2p_plugin-0.0.1a2.tar.gz.

File metadata

File hashes

Hashes for ovos_scriptconv_g2p_plugin-0.0.1a2.tar.gz
Algorithm Hash digest
SHA256 42aa565bfe8d2cf0fc2dc8aae0db69707e27eec8b3aeeec01548929902c3f780
MD5 1e9c06d335145edf05fa94db35eee8f0
BLAKE2b-256 d377006c3f2629c2f66219dc79ca7ca21759ba8abedd39561b8dbfa3888143fd

See more details on using hashes here.

File details

Details for the file ovos_scriptconv_g2p_plugin-0.0.1a2-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_scriptconv_g2p_plugin-0.0.1a2-py3-none-any.whl
Algorithm Hash digest
SHA256 9bc4b966c731211d17f4e2690c5cee6e33d0c1078f3e7226dd2004d69681762b
MD5 37d1952402b30d6333d208d0075f6339
BLAKE2b-256 9e168e92dce26b18519abad700edca3119aa6e169896d9ab23798a7bc4045b2e

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 Sentry Error logging StatusPage Status page