# NeMo-text-processing **Repository Path**: mirrors_NVIDIA/NeMo-text-processing ## Basic Information - **Project Name**: NeMo-text-processing - **Description**: NeMo text processing for ASR and TTS - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-11-16 - **Last Updated**: 2026-12-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README **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)](https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/nlp/text_normalization/intro.html). Tutorials ----------------- | Google Collab Notebook | Description | | ----------- | ----------- | | [Text_(Inverse)_Normalization.ipynb](https://github.com/NVIDIA/NeMo-text-processing/blob/main/tutorials/Text_(Inverse)_Normalization.ipynb) | Quick-start guide | | [WFST_Tutorial](https://github.com/NVIDIA/NeMo-text-processing/blob/main/tutorials/WFST_Tutorial.ipynb) | In-depth tutorial on grammar customization | Getting help -------------- If you have a question which is not answered in the [Github discussions](https://github.com/NVIDIA/NeMo-text-processing/discussions), encounter a bug or have a feature request, please create a [Github issue](https://github.com/NVIDIA/NeMo-text-processing/issues). We also welcome you to directly open a [pull request](https://github.com/NVIDIA/NeMo-text-processing/pulls) 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. ```bash conda create --name nemo_tn python==3.10 conda activate nemo_tn ``` (Optional) To use [hybrid text normalization](nemo_text_processing/hybrid/README.md) install PyTorch using their [configurator](https://pytorch.org/get-started/locally/). ### Pip Use this installation mode if you want the latest released version. ``` pip install nemo_text_processing ``` Optional features are installed as extras: ``` pip install "nemo_text_processing[audio]" # audio-based normalization (NormalizerWithAudio) pip install "nemo_text_processing[hybrid]" # hybrid text normalization, includes [audio] ``` Hybrid text normalization also needs PyTorch, which is not installed by the extra. Install the build for your system with the [PyTorch configurator](https://pytorch.org/get-started/locally/). **_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](https://www.openfst.org/twiki/bin/view/GRM/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.7"`. ### Pip from source Use this installation mode if you want a version from a particular GitHub branch (e.g. main). ``` pip install "nemo_text_processing @ git+https://github.com/NVIDIA/NeMo-text-processing.git@{BRANCH}" ``` ### From source Use this installation mode if you are contributing to NeMo-text-processing. We use [uv](https://docs.astral.sh/uv/) for development environments. ``` git clone https://github.com/NVIDIA/NeMo-text-processing cd NeMo-text-processing uv sync ``` `uv sync` creates `.venv`, installs the project in editable mode and adds the test and style tooling. Run things through it with `uv run`: ``` uv run pytest --cpu uv run python nemo_text_processing/text_normalization/normalize.py --text="1" ``` **_NOTE:_** uv is a convenience, not a requirement — the project is a standard PEP 621 package. `pip install -e ".[all]"` from the repository root does the same thing. **_NOTE:_** No `uv.lock` is committed. This is a library rather than an application, so the resolution that matters is the consumer's; run `uv lock` locally if you want one. ### Building ``` uv build ``` writes a wheel and an sdist to `dist/`. `python -m build` does the same. Contributing ------------ We welcome community contributions! Please refer to the [CONTRIBUTING.md](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](LICENSE).