Skip to main content

CLI to create a pronunciation dictionary by predicting English ARPAbet phonemes using seq2seq model from g2pE and the possibility of ignoring punctuation and splitting on hyphens before prediction.

Project description

dict-from-g2pE

PyPI PyPI MIT

CLI to create a pronunciation dictionary by predicting English ARPAbet phonemes using seq2seq model from g2pE and the possibility of ignoring punctuation and splitting on hyphens before prediction.

Installation

pip install dict-from-g2pE --user

Usage

dict-from-g2pE-cli

Example

# Create example vocabulary
cat > /tmp/vocabulary.txt << EOF
Test?
abc,
"def
Test-def.
"xyz?
"uv-w?
EOF

# Create dictionary from vocabulary and example dictionary
dict-from-g2pE-cli \
  /tmp/vocabulary.txt \
  /tmp/result.dict \
  --split-on-hyphen \
  --n-jobs 4

cat /tmp/result.dict
# -------
# Output:
# -------
# Test?  T EH1 S T ?
# abc,  AE1 B K ,
# "def  " D EH1 F
# Test-def.  T EH1 S T - D EH1 F .
# "xyz?  " Z IH1 JH IH0 Z ?
# "uv-w?  " AH1 V - V IY1 ?
# -------

Acknowledgments

g2pE: A Simple Python Module for English Grapheme To Phoneme Conversion

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

dict-from-g2pE-0.0.1.tar.gz (8.5 kB view hashes)

Uploaded source

Built Distribution

dict_from_g2pE-0.0.1-py3-none-any.whl (8.6 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page