3
3
4
4
This repository contains scripts suitable for training, evaluating and using grapheme-to-phoneme
5
5
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.
7
7
8
8
The repository includes C++ binaries suitable for training, compiling, and evaluating G2P models.
9
9
It also some simple python bindings which may be used to extract individual
10
10
multigram scores, alignments, and to dump the raw lattices in .fst format for each word.
11
11
12
+ The python scripts and bindings were tested most recently with python v3.8.5.
13
+
12
14
Standalone distributions related to previous INTERSPEECH papers, as well as the complete, exported
13
15
final version of the old google-code repository are available via ``` git-lfs ``` in a separate
14
16
repository:
@@ -17,8 +19,8 @@ repository:
17
19
#### Contact: ####
18
20
19
21
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.
22
24
23
25
```
24
26
$ sudo apt-get update
@@ -29,69 +31,73 @@ $ sudo apt-get install python-setuptools python-dev
29
31
# mitlm (to build a quick play model)
30
32
$ sudo apt-get install gfortran
31
33
```
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:
33
42
```
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
37
46
# Minimal configure, compatible with current defaults for Kaldi
38
47
$ ./configure --enable-static --enable-shared --enable-far --enable-ngram-fsts
39
- $ make -j 4
48
+ $ make -j
40
49
# Now wait a while...
41
50
$ 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):
44
52
$ echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib/fst' \
45
53
>> ~/.bashrc
46
54
$ source ~/.bashrc
55
+ $ cd ..
47
56
```
48
57
49
- Checkout the latest Phonetisaurus from master
58
+ Checkout the latest Phonetisaurus from master and compile without bindings:
50
59
```
51
60
$ git clone https://github.com/AdolfVonKleist/Phonetisaurus.git
52
61
$ cd Phonetisaurus
62
+ # if OpenFst is installed in the default location:
53
63
$ ./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
54
68
$ make
55
69
$ sudo make install
70
+ $ cd ..
56
71
```
57
72
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:
73
74
```
74
75
$ git clone https://github.com/AdolfVonKleist/Phonetisaurus.git
75
76
$ cd Phonetisaurus
76
77
$ sudo pip3 install pybindgen
78
+ # if OpenFst is installed in the default location:
77
79
$ 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
78
85
$ make
79
86
$ sudo make install
80
87
$ cd python
81
88
$ cp ../.libs/Phonetisaurus.so .
82
89
$ sudo python3 setup.py install
83
- $ cd
90
+ $ cd ../..
84
91
```
85
92
86
-
87
93
Grab and install mitlm to build a quick test model with the cmudict (5m):
88
94
```
89
95
$ git clone https://github.com/mitlm/mitlm.git
90
96
$ cd mitlm/
91
97
$ ./autogen.sh
92
98
$ make
93
99
$ sudo make install
94
- $ cd
100
+ $ cd ..
95
101
```
96
102
97
103
Grab a copy of the latest version of CMUdict and clean it up a bit:
@@ -109,7 +115,8 @@ $ cat cmudict.dict \
109
115
> cmudict.formatted.dict
110
116
```
111
117
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:
113
120
```
114
121
$ phonetisaurus-train --lexicon cmudict.formatted.dict --seq2_del
115
122
INFO:phonetisaurus-train:2017-07-09 16:35:31: Checking command configuration...
0 commit comments