overview of HTK usage from feature extraction to word recognition.
install HTK3.4.1 from http://htk.eng.cam.ac.uk/
require: create a feature definition as script.hcopy, place WAVs in speech and labels in labels.
mkdir mfcc
ls speech | sed -e "s/\.[^.]*$//g" | xargs -I {} echo speech/{}.wav mfcc/{}.mfc > script.hcopy
HCopy -C config.hcopy -S script.hcopyresult: mfcc/*.mfc
require: initial hmm definitions as *.hmm in proto
(todo: automate the creation of initial hmm definitions)
ls proto | sed -e "s/\.[^.]*$//g" > hmmlist.txt
ls mfcc | xargs printf "mfcc/%s\n" > trainlist.txt
mkdir hmm0
cat hmmlist.txt | xargs -I {} HInit -T 1 -S trainlist.txt -M hmm0 -H proto/{}.hmm -l {} -L label {}result: hmm0/*.hmm
mkdir hmm1
cat hmmlist.txt | xargs -I {} HRest -T 1 -S trainlist.txt -M hmm1 -H hmm0/{}.hmm -l {} -L label {}result: hmm1/*.hmm
require: a grammar definition as grammar.txt
HParse grammer.txt net.slfresult: net.slf
require: a dictionary of words as voca.txt
from one MFCC feature mfcc/hai1.mfc
HVite -T 1 -H hmmsdef.hmm -i reco.mlf -w net.slf voca.txt hmmlist.txt mfcc/hai1.mfc
cat reco.mlffrom MFCC feature sets trainlist.txt
HVite -T 1 -S trainlist.txt -H hmmsdef.hmm -i rec.mlf -w net.slf voca.txt hmmlist.txt
cat rec.mlfwarning: just reuse trainlist.txt as evallist here
echo '#!MLF!#' > ref.mlf
echo '"label"' >> ref.mlf
ls label | xargs printf "%s\n" >> ref.mlf
HResults -T 1 -e "???" sil -I ref.mlf -L label hmmlist.txt rec.mlfresult:
====================== HTK Results Analysis =======================
Date: Thu Aug 25 01:53:15 2016
Ref : ref.mlf
Rec : rec.mlf
------------------------ Overall Results --------------------------
SENT: %Correct=60.00 [H=6, S=4, N=10]
WORD: %Corr=60.00, Acc=60.00 [H=6, D=0, S=4, I=0, N=10]
===================================================================