机器环境:
gcc=4.9.4
openfst=1.6.7
thrax=1.2.6
git拉取代码:https://github.com/speechio/chinese_text_normalization.git
然后执行:
cd $KALDI_ROOT/tools/openfst
进入openfst目录,如果是非root权限安装,需要加上--prefix=/your/own/path/,例如装在/home/xxx/openfst-1.6.7/,分步执行命令:
./configure -enable-far --enable-pdt --enable-mpdt --prefix=/home/xxx/openfst-1.6.7/
make -j
make install
然后安装Thrax,将install_thrax.sh脚本拷贝到$KALDI_ROOT/tools/extras/,执行:
sh extras/install_thrax.sh
这一步最容易出现问题,脚本里写死的是1.2.9版本,如果跟openfst的版本不匹配,会出现错误比如:
error: 'splittovector' is not a member of 'fst'
原因是版本不匹配,版本更迭竟然会改变量名字,不知道作者咋想的。
再提醒一次:openfst=1.6.7, thrax=1.2.6 亲测可行,别在版本上浪费太多时间。