歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Linux下安裝編譯並且測試HTK語音識別庫

Linux下安裝編譯並且測試HTK語音識別庫

日期:2017/3/1 10:00:23   编辑:Linux編程

決定寫一個linux下的HTK的安裝和測試,如果有人想看windows下的,可以看我之前的那篇文章 http://www.linuxidc.com/Linux/2013-03/80801.htm。

首先前提是要確保自己安裝了g++和libx11

解壓HTK-3.4.1.tar.gz

sudo tar xzf HTK-3.4.1.tar.gz

然後:

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

出現:

setting
config.status: creating HTKLVRec/Makefile
config.status: WARNING: HTKLVRec/Makefile.in seems to ignore the --datarootdir setting
config.status: creating Makefile
config.status: WARNING: Makefile.in seems 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" to install them.

The tools will be installed in /usr/local//bin

Build notes: Language Modelling tools will be
built. HDecode will not be built. You can build
it manually later by running 'make hdecode
install-hdecode'

**************************************************

之後試了幾次,都是由於自己的環境的錯誤給中斷了,但是最後用了忽略錯誤編譯成功了。

之後出現:

zhangju@Ubuntu:/usr/local/bin$ ls
Cluster HERest HLMCopy HQuant HVite LGList LNorm
HBuild HHEd HLRescore HRest LAdapt LGPrep LPlex
HCompV HInit HLStats HResults LBuild LLink LSubset
HCopy HLEd HMMIRest HSGen LFoF LMerge
HDMan HList HParse HSmooth LGCopy LNewMap

測試命令:

zhangju@ubuntu:/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 def in fn (name only) outDir/srcfn
-u mvwt Update m)eans v)ars w)ghts t)rans mvwt
-v f Set minimum variance to f 1.0E-2
-w f set mix wt/disc prob floor to f 0.0
-A Print command line arguments off
-B Save HMMs/transforms as binary off
-C cf Set config file to cf default
-D Display configuration variables off
-F fmt Set source data format to fmt as config
-G fmt Set source label format to fmt as config
-H mmf Load HMM macro file mmf
-I mlf Load master label file mlf
-L dir Set input label (or net) dir current
-M dir Dir to write HMM macro files current
-S f Set script file to f none
-T N Set trace flags to N 0
-V Print version information off
-X ext Set input label (or net) file ext lab

出現以上表示安裝成功。
下面測試DEMO:

tar xzf HTK-samples-3.4.1.tar.gz
cd samples
cd HTKDemo
mkdir -p hmms/{tmp,hmm.{0,1,2,3}} proto acc test
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]
===================================================================

表示HTK工具包安裝並測試通過。

寫了兩篇關於HTK分別在windows和linux環境下安裝和編譯的文章,下面可能要繼續開始鑽研如何使用。希望兩篇文章對大家有幫助,歡迎互相討論。

基於Windows的那篇見:http://www.linuxidc.com/Linux/2013-03/80800.htm

Copyright © Linux教程網 All Rights Reserved