Skip to main content

NeMo text processing for ASR and TTS

Project description

NeMo Text Processing

Introduction

nemo-text-processing is a Python package for text normalization and inverse text normalization.

Documentation

NeMo-text-processing (text normalization and inverse text normalization).

Tutorials

Google Collab Notebook Description
Text_(Inverse)_Normalization.ipynb Quick-start guide
WFST_Tutorial In-depth tutorial on grammar customization

Getting help

If you have a question which is not answered in the Github discussions, encounter a bug or have a feature request, please create a Github issue. We also welcome you to directly open a pull request to fix a bug or add a feature.

Installation

Conda virtual environment

We recommend setting up a fresh Conda environment to install NeMo-text-processing.

conda create --name nemo_tn python==3.10
conda activate nemo_tn

(Optional) To use hybrid text normalization install PyTorch using their configurator.

conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch

NOTE: The command used to install PyTorch may depend on your system.

Pip

Use this installation mode if you want the latest released version.

pip install nemo_text_processing

NOTE: This should work on any Linux OS with x86_64. Pip installation on MacOS and Windows are not supported due to the dependency Pynini. On a platform other than Linux x86_64, installing from Pip tries to compile Pynini from scratch, and requires OpenFst headers and libraries to be in the expected place. So if it's working for you, it's because you happen to have installed OpenFst in the right way in the right place. So if you want to Pip install Pynini on MacOS, you have to have pre-compiled and pre-installed OpenFst. The Pynini README for that version should tell you which version it needs and what --enable-foo flags to use. Instead, we recommend you to use conda-forge to install Pynini on MacOS or Windows: conda install -c conda-forge pynini=2.1.6.post1.

Pip from source

Use this installation mode if you want the a version from particular GitHub branch (e.g main).

pip install Cython
python -m pip install git+https://github.com/NVIDIA/NeMo-text-processing.git@{BRANCH}#egg=nemo_text_processing

From source

Use this installation mode if you are contributing to NeMo-text-processing.

git clone https://github.com/NVIDIA/NeMo-text-processing
cd NeMo-text-processing
./reinstall.sh

NOTE: If you only want the toolkit without additional conda-based dependencies, you may replace reinstall.sh with pip install -e . with the NeMo-text-processing root directory as your current working director.

Contributing

We welcome community contributions! Please refer to the CONTRIBUTING.md for guidelines.

Citation

@inproceedings{zhang21ja_interspeech,
  author={Yang Zhang and Evelina Bakhturina and Boris Ginsburg},
  title={{NeMo (Inverse) Text Normalization: From Development to Production}},
  year=2021,
  booktitle={Proc. Interspeech 2021},
  pages={4857--4859}
}

@inproceedings{bakhturina22_interspeech,
  author={Evelina Bakhturina and Yang Zhang and Boris Ginsburg},
  title={{Shallow Fusion of Weighted Finite-State Transducer and Language Model for
Text Normalization}},
  year=2022,
  booktitle={Proc. Interspeech 2022}
}

License

NeMo-text-processing is under Apache 2.0 license.

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

nemo_text_processing-1.1.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

nemo_text_processing-1.1.0-py3-none-any.whl (2.7 MB view details)

Uploaded Python 3

File details

Details for the file nemo_text_processing-1.1.0.tar.gz.

File metadata

  • Download URL: nemo_text_processing-1.1.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for nemo_text_processing-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c1597bce52e74204a462095e90311e2ba6c7293654b7a3c5adccca011a1a6518
MD5 859a29a434891c57b09b0f04f1f37212
BLAKE2b-256 bbf47e8cd790557d12954358e034330267a51121fd9e0c9bfc97874551fc2540

See more details on using hashes here.

File details

Details for the file nemo_text_processing-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nemo_text_processing-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bc16b13ec77632056460e6a1ce135a582cf41683ed85f6ace505af20785767d
MD5 b0288a1bea0815bd79fde342fe4784f8
BLAKE2b-256 096df066481b52b3c8c7826454e54b4ca085c5fdbe8f090e56257140e020d662

See more details on using hashes here.

Supported by

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