Ubuntu14.04环境下安装编译HTK语音识别工具库

2016-07-12 10:27:31来源:oschina作者:断桥残雪断桥残雪人点击

1 下载HTK


HTK官网是:http://htk.eng.cam.ac.uk/,进入即可下载。


2 编译HTK


首先确保你已经安装了g++和libx11,


sudo apt-getinstall libx11-dev:i386


解压HTK工具包,进入ht文件夹下面


sudo tar xzf HTK-3.4.1.tar.gz


cd htk


然后输入下面一段代码:


sudo ./configure --prefix=/usr/local/


(这样安装好的文件即可存放在/usr/local目录下面)


出现下面一段提示:



setting config.status: creating HTKLVRec/Makefile config.status: WARNING: HTKLVRec/Makefile.inseems to ignore the --datarootdir setting config.status: creating Makefile config.status: WARNING: Makefile.inseems to ignore the --datarootdir setting **************************************************HTK is now ready to be built.Type"make all"to build the HTK libraries and tools.Then"make install"toinstallthem.The tools will be installedin/usr/local//binBuild notes: Language Modelling tools will be built. HDecode will not be built. You can build it manually later by running 'makehdecode install-hdecode'**************************************************
按照上面提示中所说,接下来依次输入以下命令

sudo make all


sudo make install


sudo make hdecode install-hdecode


3 测试HTK


进入/usr/local/bin目录下面


cd /usr/local/bin


然后输入


HInit


若出现以下信息则表明安装成功:



USAGE: HInit [options] hmmFile trainFiles...Option Default-e f Set convergence factor epsilon 1.0E-4 -i N Set max iterations to N 20 -l s Set segment label to s none -m N Set min segments needed 3 -n Update hmm (suppress uniform seg) off -o fn Store new hmm definfn (name only) outDir/srcfn -u mvwt Update m)eansv)ars w)ghts t)rans mvwt -vf Set minimum variance to f 1.0E-2 -w fsetmix wt/discprob floor to f 0.0 -A Printcommandline arguments off -B Save HMMs/transformsas binary off -C cf Set configfileto cf default -D Display configuration variables off -FfmtSetsourcedataformattofmtas config -GfmtSetsourcelabelformattofmtas config -H mmf Load HMM macrofilemmf -I mlf Load master labelfilemlf -LdirSet input label (or net)dircurrent -MdirDir to write HMM macro files current -S f Set scriptfileto f none -T N Set trace flags to N 0 -V Print version information off


4 运行htkDemo


首先解压htk-samples,进入HTKDemo文件夹中



tar xzf HTK-samples-3.4.1.tar.gz cd samples

cd HTKDemo



然后依次输入以下命令:



mkdir-p hmms/{tmp,hmm.{0,1,2,3}} proto acctest perl runDemo configs/monPlainM1S1.dcf
若出现以下信息,证明测试通过:


====================== HTK Results Analysis ======================= Date: Mon Mar 11 16:45:40 2013 Ref : labels/bcplabs/mon Rec :test/te1.rec :test/te2.rec :test/te3.rec ------------------------ Overall Results -------------------------- SENT: %Correct=0.00 [H=0, S=3, N=3] WORD: %Corr=63.91, Acc=59.40 [H=85, D=35, S=13, I=6, N=133] ===================================================================

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台