1. 安裝
git clone https://github.com/kaldi-asr/kaldi.git
cd kaldi/tools/; make; cd ../src; ./configure; make
環(huán)境問題.png
一大堆東西沒裝,給跪了
安裝automake和autoconf
brew install wget
2. 主要目錄結構
egs – 完整流程例子腳本,
misc – 輔助工具,
src – kaldi源代碼,
tools – 有用的模塊和工具,
windows – windows用工具.
3. pipeline
3.1 數(shù)據(jù)準備
lexicon: 文字->聲音 AAW -> ey ey d ah b y uw
G.txt (bigram decoding graph, in OpenFst text format)
聲音和人的映射關系: utt2spk/spk2utt
symbol-tables for words and phones (OpenFst format)
詞/音素建立id-mapping
創(chuàng)建binary-format FST,用整數(shù)代替字符
data/G.fst(語法), data/L.fst(lexicon), data/L_disambig.fst
發(fā)聲/不發(fā)聲的音素id
3.2 特征提取
“ark”==archive, “scp”==script file
# head /foo/raw_mfcc.scp
trn_adg04_sr009 /foo/raw_mfcc.ark:16
trn_adg04_sr049 /foo/raw_mfcc.ark:23395
...
# head –c 20 foo/raw_mfcc.ark
trn_adg04_sr009 ^@BFM [binary data...]
archive文件
script文件
三種Table處理
TableWriter 按順序寫
SequentialTableReader 遍歷讀
RandomAccessTableReader 按key查指定value
為啥沒有隨機寫?沒這個場景,算都是批量算,遍歷寫就可以了
The Table concept
提取MFCC特征
3.3 單音訓練
- 設置變量
- 創(chuàng)建topo文件
- 初始化模型(flat start of the model/ 沒有split的決策樹)
-
創(chuàng)建解碼圖
decoding graph -
對齊初始化
alignment -
單音訓練
Monophone training - 多音訓練
- 多音訓練創(chuàng)建樹
- 解碼:創(chuàng)建圖
訓練部分有點復雜,看看其他資料,回頭再補充
更多參考