Skip to content

Commit 8e23bd8

Browse files
Install (#35)
* remove conda pynini install Signed-off-by: Yang Zhang <yangzhang@nvidia.com> * added pynini install note Signed-off-by: Yang Zhang <yangzhang@nvidia.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix text Signed-off-by: Yang Zhang <yangzhang@nvidia.com> --------- Signed-off-by: Yang Zhang <yangzhang@nvidia.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 41465e0 commit 8e23bd8

7 files changed

Lines changed: 25 additions & 28 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ Use this installation mode if you want the latest released version.
5454
pip install nemo_text_processing
5555
```
5656

57+
**_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.
58+
Instead, we recommend you to use conda-forge to install Pynini on MacOS or Windows:
59+
`conda install -c conda-forge pynini=2.1.5`.
60+
61+
5762
### Pip from source
5863

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

install_pynini.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

reinstall.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,4 @@ else
2121
${PIP} install "${DIST_FILE}[all]"
2222
fi
2323

24-
echo 'Installing additional pynini dependency'
25-
bash install_pynini.sh > /dev/null 2>&1 && echo "nemo_text_processing installed!" || echo "nemo_text_processing could not be installed!"
26-
2724
echo 'All done!'

requirements/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ inflect
33
jiwer>2.3.0
44
joblib
55
pandas
6+
pynini==2.1.5
67
regex
78
sacremoses>=0.0.43
89
setuptools==59.5.0

requirements/requirements_test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ black==19.10b0
22
click==8.0.2
33
isort[requirements] < 5
44
parameterized
5+
pynini==2.1.5
56
pytest
67
pytest-runner
78
ruamel.yaml

tutorials/Text_(Inverse)_Normalization.ipynb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@
6161
"source": [
6262
"## Install NeMo, which installs both nemo and nemo_text_processing package\n",
6363
"BRANCH = 'main'\n",
64-
"!python -m pip install git+https://github.com/NVIDIA/NeMo.git@$BRANCH#egg=nemo_toolkit[nlp]\n",
65-
"\n",
66-
"# install Pynini for text normalization\n",
67-
"! wget https://raw.githubusercontent.com/NVIDIA/NeMo/main/nemo_text_processing/install_pynini.sh\n",
68-
"! bash install_pynini.sh"
64+
"!python -m pip install git+https://github.com/NVIDIA/NeMo-text-processing.git@$BRANCH#egg=nemo_text_processing"
6965
]
7066
},
7167
{
@@ -142,7 +138,7 @@
142138
"print(normalized)"
143139
]
144140
},
145-
{
141+
{
146142
"cell_type": "markdown",
147143
"metadata": {},
148144
"source": [
@@ -446,7 +442,7 @@
446442
"toc_visible": true
447443
},
448444
"kernelspec": {
449-
"display_name": "Python 3 (ipykernel)",
445+
"display_name": "Python 3.8.10 64-bit",
450446
"language": "python",
451447
"name": "python3"
452448
},
@@ -460,7 +456,12 @@
460456
"name": "python",
461457
"nbconvert_exporter": "python",
462458
"pygments_lexer": "ipython3",
463-
"version": "3.9.7"
459+
"version": "3.8.10"
460+
},
461+
"vscode": {
462+
"interpreter": {
463+
"hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1"
464+
}
464465
}
465466
},
466467
"nbformat": 4,

tutorials/WFST_Tutorial.ipynb

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"source": [
2929
"\n",
3030
"## Prerequisites:\n",
31-
"1. Please make sure to read the [Text Processing Documentation](https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/stable/nlp/text_normalization/wfst/intro.html) and [Text Normalization Introduction Tutorial](https://colab.research.google.com/github/NVIDIA/NeMo/blob/stable/tutorials/text_processing/Text_(Inverse)_Normalization.ipynb) **before** this notebook. This notebook is a in-depth tutorial on how to customize and develop your own text normalization or inverse text normalization grammars.\n",
31+
"1. Please make sure to read the [Text Processing Documentation](https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/stable/nlp/text_normalization/wfst/intro.html) and [Text Normalization Introduction Tutorial](https://colab.research.google.com/github/NVIDIA/NeMo-text-processing/blob/main/tutorials/Text_(Inverse)_Normalization.ipynb) **before** this notebook. This notebook is a in-depth tutorial on how to customize and develop your own text normalization or inverse text normalization grammars.\n",
3232
"2. download NeMo source code"
3333
]
3434
},
@@ -40,11 +40,7 @@
4040
"source": [
4141
"## Install NeMo, which installs both nemo and nemo_text_processing package\n",
4242
"BRANCH = 'main'\n",
43-
"!python -m pip install git+https://github.com/NVIDIA/NeMo.git@$BRANCH#egg=nemo_toolkit[nemo_text_processing]\n",
44-
"\n",
45-
"# install Pynini for text normalization\n",
46-
"! wget https://raw.githubusercontent.com/NVIDIA/NeMo/main/nemo_text_processing/install_pynini.sh\n",
47-
"! bash install_pynini.sh"
43+
"!python -m pip install git+https://github.com/NVIDIA/NeMo-text-processing.git@$BRANCH#egg=nemo_text_processing"
4844
]
4945
},
5046
{
@@ -7028,11 +7024,8 @@
70287024
"provenance": [],
70297025
"toc_visible": true
70307026
},
7031-
"interpreter": {
7032-
"hash": "fbc643a332f9d7801191710b24a8a955d342df4f32791f7fb65121dc4784751f"
7033-
},
70347027
"kernelspec": {
7035-
"display_name": "Python 3 (ipykernel)",
7028+
"display_name": "Python 3.8.10 64-bit",
70367029
"language": "python",
70377030
"name": "python3"
70387031
},
@@ -7046,7 +7039,12 @@
70467039
"name": "python",
70477040
"nbconvert_exporter": "python",
70487041
"pygments_lexer": "ipython3",
7049-
"version": "3.9.7"
7042+
"version": "3.8.10"
7043+
},
7044+
"vscode": {
7045+
"interpreter": {
7046+
"hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1"
7047+
}
70507048
}
70517049
},
70527050
"nbformat": 4,

0 commit comments

Comments
 (0)