今天晚上又来了兴致,决定写一个linux下的HTK的安装和测试,如果有人想看windows下的,可以看我之前的那篇博文。

      首先前提是要确保自己安装了g++和libx11

1 sudo apt-get install libx11-dev:i386(libX11.so)

       解压HTK-3.4.1.tar.gz

1 sudo tar xzf HTK-3.4.1.tar.gz
      然后:
1 sudo ./configure --prefix=/usr/local/
      出现:
01 setting
02 config.status: creating HTKLVRec/Makefile
03 config.status: WARNING:  HTKLVRec/Makefile.in seems to ignore the --datarootdir setting
04 config.status: creating Makefile
05 config.status: WARNING:  Makefile.in seems to ignore the --datarootdir setting
06 **************************************************
07  
08 HTK is now ready to be built.
09  
10 Type "make all" to build the HTK libraries
11 and tools.
12  
13 Then "make install" to install them.
14  
15 The tools will be installed in /usr/local//bin
16  
17 Build notes: Language Modelling tools will be
18 built. HDecode will not be built. You can build
19 it manually later by running 'make hdecode
20 install-hdecode'
21  
22 **************************************************

 之后试了几次,都是由于自己的环境的错误给中断了,但是最后用了忽略错误编译成功了。

之后出现:

1 zhangju@ubuntu:/usr/local/bin$ ls
2 Cluster  HERest  HLMCopy    HQuant    HVite   LGList   LNorm
3 HBuild   HHEd    HLRescore  HRest     LAdapt  LGPrep   LPlex
4 HCompV   HInit   HLStats    HResults  LBuild  LLink    LSubset
5 HCopy    HLEd    HMMIRest   HSGen     LFoF    LMerge
6 HDMan    HList   HParse     HSmooth   LGCopy  LNewMap
测试命令:
01 zhangju@ubuntu:/usr/local/bin$ HInit
02  
03 USAGE: HInit [options] hmmFile trainFiles...
04  
05  Option                                       Default
06  
07  -e f    Set convergence factor epsilon       1.0E-4
08  -i N    Set max iterations to N              20
09  -l s    Set segment label to s               none
10  -m N    Set min segments needed              3
11  -n      Update hmm (suppress uniform seg)    off
12  -o fn   Store new hmm def in fn (name only)  outDir/srcfn
13  -u mvwt Update m)eans v)ars w)ghts t)rans    mvwt
14  -v f    Set minimum variance to f            1.0E-2
15  -w f    set mix wt/disc prob floor to f      0.0
16  -A      Print command line arguments         off
17  -B      Save HMMs/transforms as binary       off
18  -C cf   Set config file to cf                default
19  -D      Display configuration variables      off
20  -F fmt  Set source data format to fmt        as config
21  -G fmt  Set source label format to fmt       as config
22  -H mmf  Load HMM macro file mmf
23  -I mlf  Load master label file mlf
24  -L dir  Set input label (or net) dir         current
25  -M dir  Dir to write HMM macro files         current
26  -S f    Set script file to f                 none
27  -T N    Set trace flags to N                 0
28  -V      Print version information            off
29  -X ext  Set input label (or net) file ext    lab
出现以上表示安装成功。

下面测试DEMO:

1 tar xzf HTK-samples-3.4.1.tar.gz
2 cd samples
3 cd HTKDemo
4 mkdir -p hmms/{tmp,hmm.{0,1,2,3}} proto acc test
5 perl runDemo configs/monPlainM1S1.dcf
如果出现以下显示:
01 ====================== HTK Results Analysis =======================
02   Date: Mon Mar 11 16:45:40 2013
03   Ref : labels/bcplabs/mon
04   Rec : test/te1.rec
05       test/te2.rec
06       test/te3.rec
07 ------------------------ Overall Results --------------------------
08 SENT: %Correct=0.00 [H=0, S=3, N=3]
09 WORD: %Corr=63.91, Acc=59.40 [H=85, D=35, S=13, I=6, N=133]
10 ===================================================================
表示HTK工具包安装并测试通过。

这两天写了两篇关于HTK分别在windows和linux环境下安装和编译的文章,下面可能要继续开始钻研如何使用。希望两篇文章对大家有帮助,欢迎互相讨论。

基于windows的那篇见:http://my.oschina.net/jamesju/blog/112602

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐