语音识别学习记录 [kaldi中的openfst]
在Kaldi tutorial: Overview of the distribution中介紹了一個使用openfst的例子。先來介紹一下這個例子,再來說明FST(finite-state transducers,有限狀態機)如何應用到語音識別中。
首先有三個文件,text.fst、isyms.txt、osyms.txt。
text.fst文件的內容為(請無視前面的行號):
0 1 a x .5 0 1 b y 1.5 1 2 c z 2.5 2 3.5前三行是FST中的弧(arc),格式為[ 起點(src),終點(dest),輸入標簽(ilabel),輸出標簽(olabel) ,權重(weight)];弧在文件中的順序可以交換,但是初始狀態的弧必須在第一行。最后一行為最終狀態的編號和最終狀態的權值。這個文件描述的是FST的結構,根據這個文件可以得到下圖:
從上圖可以看出字符串ac到xz的轉換的權重為0.5+2.5+3.5=6.5.
關于這個圖的說明放一段openFst教程中的原話:The?initial state?is label 0. There can only be one initial state. The?final state?is 2 with final weight of 3.5. Any state with non-infinite final weight is a final state. There is an?arc?(or?transition) from state 0 to 1 with?input label?a,?output label?x, and?weight?0.5. This FST transduces, for instance, the string?ac?to?xz?with weight 6.5 (the sum of the arc and final weights). Note we have assumed the library default?Weight?type for this description.
isyms.txt文件內容為:
<eps> 0 a 1 b 2 c 3osyms.txt文件內容為:
<eps> 0 x 1 y 2 z 3isyms.txt和osyms.txt是輸入標簽和輸出標簽對應的符號。因為FST的輸入標簽和輸出標簽在內部都是用數字表示的,所以要有這么兩個符號表。可以使用任意的非負整數作為符號的ID。那個為0的標簽ID是為epsilon標簽保存的,epsilon是一個空字符串。上面的例子中并沒有用到epsilon這個標簽,openFST的教程上面說以后會用到,具體干什么我也還不清楚。
以上內容主要來自openFst官網的FstQuickTour。
?
總結
以上是生活随笔為你收集整理的语音识别学习记录 [kaldi中的openfst]的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 114个ChatGPT全网最热话题
- 下一篇: arcgis 属性表中起点终点创建线_一