这几天发现,HMM的基础理论还是需要再巩固一下,这样才能在此基础上进一步做优化和改进的工作。


 209  (2014-04-18) (13:32:00) cd ~/Downloads/
  210  (2014-04-18) (13:32:01) ls
  211  (2014-04-18) (13:32:41) mkdir ~/HTK
  212  (2014-04-18) (13:33:02) tar -xzvf HTK-3.4.1.tar.gz -C ~/HTK/
  213  (2014-04-18) (13:33:11) tar -xzvf HTK-samples-3.4.1.tar.gz -C ~/HTK/
  214  (2014-04-18) (13:33:15) ls


   39  (2014-04-18) (14:58:10) cd ~/HTK/
   40  (2014-04-18) (14:58:11) ls
   41  (2014-04-18) (14:58:13) cd htk/
   42  (2014-04-18) (14:58:13) ls
   43  (2014-04-18) (14:58:17) sudo ./configure --prefix=/usr/local/
   45  (2014-04-18) (15:28:28) make install
   46  (2014-04-18) (15:28:35) sudo make install
   47  (2014-04-18) (15:29:01) HInit
   48  (2014-04-18) (15:29:11) cd ..
   49  (2014-04-18) (15:29:12) ls
   50  (2014-04-18) (15:29:13) cd samples/
   51  (2014-04-18) (15:29:13) ls
   52  (2014-04-18) (15:29:19) cd HTKTutorial/
   53  (2014-04-18) (15:29:20) ls
   54  (2014-04-18) (15:29:41) cd ../HTKDemo/
   55  (2014-04-18) (15:29:42) ls
   56  (2014-04-18) (15:30:17) mkdir -p hmms/{tmp,hmm.{0,1,2,3}} proto acc test
   57  (2014-04-18) (15:30:33) perl runDemo configs/monPlainM1S1.dcf
   58  (2014-04-18) (15:33:50) history


Linux下安装编译并且测试HTK语音识别库

首先前提是要确保自己安装了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工具包安装并测试通过。

Logo

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

更多推荐