Skip to main content

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.1.tar.gz (9.8 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.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for ovos_scriptconv_g2p_plugin-0.0.1.tar.gz
Algorithm Hash digest
SHA256 704d21cfe64bf9666b176350d2267caa9e3b26ed620e4eda4db691b37f26e8a8
MD5 09118482b90e0f2cf6bc74d8337d8949
BLAKE2b-256 07f76dcc8ba907527714b1d74d3e51f7f059a1974d03a7f19a107db33e3e654b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ovos_scriptconv_g2p_plugin-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4908178246fddb019672164d1d6bbe7b0afdf0af00c016d17e6ae8c4698dfc44
MD5 4076e9fd2a2c5f1484933f84d6bea660
BLAKE2b-256 74ac2996505419b0d72f108a37b0a7558ec0b5927892ca6a51515724dbd18800

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