Skip to content

Commit f08d3df

Browse files
Update instructions to default to python3.8 and OpenFst 1.7.2.
1 parent 23f182f commit f08d3df

File tree

1 file changed

+37
-30
lines changed

1 file changed

+37
-30
lines changed

README.md

+37-30
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33

44
This repository contains scripts suitable for training, evaluating and using grapheme-to-phoneme
55
models for speech recognition using the OpenFst framework. The current build requires OpenFst
6-
version 1.6.0 or later, and the examples below use version 1.6.2.
6+
version 1.6.0 or later, and the examples below use version 1.7.2.
77

88
The repository includes C++ binaries suitable for training, compiling, and evaluating G2P models.
99
It also some simple python bindings which may be used to extract individual
1010
multigram scores, alignments, and to dump the raw lattices in .fst format for each word.
1111

12+
The python scripts and bindings were tested most recently with python v3.8.5.
13+
1214
Standalone distributions related to previous INTERSPEECH papers, as well as the complete, exported
1315
final version of the old google-code repository are available via ```git-lfs``` in a separate
1416
repository:
@@ -17,8 +19,8 @@ repository:
1719
#### Contact: ####
1820
1921

20-
#### Scratch Build for OpenFst v1.6.2 and Ubuntu 14.04/16.04 ####
21-
This build was tested via AWS EC2 with a fresh Ubuntu 14.04 and 16.04 base, and m4.large instance.
22+
#### Scratch Build for OpenFst v1.7.2 and Ubuntu 20.04 ####
23+
This build was tested via AWS EC2 with a fresh Ubuntu 20.04 base, and m4.large instance.
2224

2325
```
2426
$ sudo apt-get update
@@ -29,69 +31,73 @@ $ sudo apt-get install python-setuptools python-dev
2931
# mitlm (to build a quick play model)
3032
$ sudo apt-get install gfortran
3133
```
32-
Next grab and install OpenFst-1.6.2 (10m-15m):
34+
35+
Create a work directory of your choice:
36+
```
37+
$ mkdir g2p
38+
$ cd g2p/
39+
```
40+
41+
Next grab and install OpenFst-1.7.2:
3342
```
34-
$ wget http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.6.2.tar.gz
35-
$ tar -xvzf openfst-1.6.2.tar.gz
36-
$ cd openfst-1.6.2
43+
$ wget http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.7.2.tar.gz
44+
$ tar -xvzf openfst-1.7.2.tar.gz
45+
$ cd openfst-1.7.2
3746
# Minimal configure, compatible with current defaults for Kaldi
3847
$ ./configure --enable-static --enable-shared --enable-far --enable-ngram-fsts
39-
$ make -j 4
48+
$ make -j
4049
# Now wait a while...
4150
$ sudo make install
42-
$ cd
43-
# Extend your LD_LIBRARY_PATH .bashrc:
51+
# Extend your LD_LIBRARY_PATH .bashrc (assumes OpenFst installed to default location):
4452
$ echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib/fst' \
4553
>> ~/.bashrc
4654
$ source ~/.bashrc
55+
$ cd ..
4756
```
4857

49-
Checkout the latest Phonetisaurus from master
58+
Checkout the latest Phonetisaurus from master and compile without bindings:
5059
```
5160
$ git clone https://github.com/AdolfVonKleist/Phonetisaurus.git
5261
$ cd Phonetisaurus
62+
# if OpenFst is installed in the default location:
5363
$ ./configure
64+
# if OpenFst is installed in a special location:
65+
$ ./configure \
66+
--with-openfst-includes=${OFST_PATH}/openfst-1.7.2/include \
67+
--with-openfst-libs=${OFST_PATH}/openfst-1.7.2/lib
5468
$ make
5569
$ sudo make install
70+
$ cd ..
5671
```
5772

58-
or, if you want to compile with python bindings
59-
```
60-
$ git clone https://github.com/AdolfVonKleist/Phonetisaurus.git
61-
$ cd Phonetisaurus
62-
$ sudo pip install pybindgen
63-
$ ./configure --enable-python
64-
$ make
65-
$ sudo make install
66-
$ cd python
67-
$ cp ../.libs/Phonetisaurus.so .
68-
$ sudo python setup.py install
69-
$ cd
70-
```
71-
72-
or, if you want to compile with python3 bindings
73+
Checkout the latest Phonetisaurus from master and compile with python3 bindings:
7374
```
7475
$ git clone https://github.com/AdolfVonKleist/Phonetisaurus.git
7576
$ cd Phonetisaurus
7677
$ sudo pip3 install pybindgen
78+
# if OpenFst is installed in the default location:
7779
$ PYTHON=python3 ./configure --enable-python
80+
# if OpenFst is installed in a special location:
81+
$ PYTHON=python3 ./configure \
82+
--with-openfst-includes=${OFST_PATH}/openfst-1.7.2/include \
83+
--with-openfst-libs=${OFST_PATH}/openfst-1.7.2/lib \
84+
--enable-python
7885
$ make
7986
$ sudo make install
8087
$ cd python
8188
$ cp ../.libs/Phonetisaurus.so .
8289
$ sudo python3 setup.py install
83-
$ cd
90+
$ cd ../..
8491
```
8592

86-
8793
Grab and install mitlm to build a quick test model with the cmudict (5m):
8894
```
8995
$ git clone https://github.com/mitlm/mitlm.git
9096
$ cd mitlm/
9197
$ ./autogen.sh
9298
$ make
9399
$ sudo make install
94-
$ cd
100+
$ cd ..
95101
```
96102

97103
Grab a copy of the latest version of CMUdict and clean it up a bit:
@@ -109,7 +115,8 @@ $ cat cmudict.dict \
109115
> cmudict.formatted.dict
110116
```
111117

112-
Train a complete model with default parameters using the wrapper script:
118+
Train a complete model with default parameters using the wrapper script.
119+
NOTE: this assumes the tool was compiled with the python3 bindings:
113120
```
114121
$ phonetisaurus-train --lexicon cmudict.formatted.dict --seq2_del
115122
INFO:phonetisaurus-train:2017-07-09 16:35:31: Checking command configuration...

0 commit comments

Comments
 (0)