ubuntu下安装kaldi
准备开始接触NLP,KAIDI
因为开源嘛,先学习安装吧。
下载
我是找到了网页http://www.kaldi-asr.org/doc/install.html,按照里面的指导
git clone https://github.com/kaldi-asr/kaldi.git kaldi --origin upstream
cd kaldi
git pull
安装
进入kaldi的目录,打开INSTALL文件,在linux下有两个安装选择
(1)
go to tools/ and follow INSTALL instructions there.
(2)
go to src/ and follow INSTALL instructions there.
我进入了tools目录,接着阅读INSTALL文件,这里提示的多了
To check the prerequisites for Kaldi, first run
extras/check_dependencies.sh
and see if there are any system-level installations you need to do. Check the
output carefully. There are some things that will make your life a lot easier
if you fix them at this stage. If your system default C++ compiler is not
supported, you can do the check with another compiler by setting the CXX
environment variable, e.g.
CXX=g++-4.8 extras/check_dependencies.sh
Then run
make
which by default will install ATLAS headers, OpenFst, SCTK and sph2pipe.
OpenFst requires a relatively recent C++ compiler with C++11 support, e.g.
g++ >= 4.7, Apple clang >= 5.0 or LLVM clang >= 3.3. If your system default
compiler does not have adequate support for C++11, you can specify a C++11
compliant compiler as a command argument, e.g.
make CXX=g++-4.8
If you have multiple CPUs and want to speed things up, you can do a parallel
build by supplying the "-j" option to make, e.g. to use 4 CPUs
make -j 4
In extras/, there are also various scripts to install extra bits and pieces that
are used by individual example scripts. If an example script needs you to run
one of those scripts, it will tell you what to do.
先按照提示运行extras/check_dependencies.sh,如果你的ubuntu和我的一样小白,会有如下提示:
extras/check_dependencies.sh: g++ (g++-4.8) is not supported.
extras/check_dependencies.sh: You need g++ >= 4.8.3, Apple clang >= 5.0 or LLVM clang >= 3.3.
extras/check_dependencies.sh: automake is not installed.
extras/check_dependencies.sh: autoconf is not installed.
extras/check_dependencies.sh: sox is not installed.
extras/check_dependencies.sh: neither libtoolize nor glibtoolize is installed
extras/check_dependencies.sh: subversion is not installed
extras/check_dependencies.sh: we recommend that you run (our best guess):
sudo apt-get install automake autoconf sox libtool subversion
先按照提示运行sudo apt-get install automake autoconf sox libtool subversion,安装好这些工具还不行,因为g++还没有安装。用如下安装g++:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.8
安装好了可以直接用make CXX=g+±4.8 在本地编译安装。安装后还有一个提示:
extras/install_irstlm.sh
继续装完。系统就可以在你的Ubuntu上工作了。