音声認識メモ(Kaldi)その6(学習 その3)
モノフォンのモデルをもとに、トライフォンのモデルを作成する。
まずは、統計量を作成。
bin/acc-tree-stats --ci-phones=1:2:3:4:5:6:7:8:9:10 2.mdl ark:mosimosi.ark ark:1.ali treeacc
phone index 1〜5は「sil」、6〜10は「spn(spoken noise)」
続けて、決定木作成時に与える質問リストを作成。
bin/cluster-phones treeacc sets.int questions.int
(参考)インプットデータ「sets.int」
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
phone index 11〜14は「I」、15〜18は「M」、19〜22は「O」、23〜26は「S」
コンパイルする。
bin/compile-questions topo questions.int questions.qst
(参考)インプットデータ「topo」
<Topology> <TopologyEntry> <ForPhones> 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 </ForPhones> <State> 0 <PdfClass> 0 <Transition> 0 0.75 <Transition> 1 0.25 </State> <State> 1 <PdfClass> 1 <Transition> 1 0.75 <Transition> 2 0.25 </State> <State> 2 <PdfClass> 2 <Transition> 2 0.75 <Transition> 3 0.25 </State> <State> 3 </State> </TopologyEntry> <TopologyEntry> <ForPhones> 1 2 3 4 5 6 7 8 9 10 </ForPhones> <State> 0 <PdfClass> 0 <Transition> 0 0.25 <Transition> 1 0.25 <Transition> 2 0.25 <Transition> 3 0.25 </State> <State> 1 <PdfClass> 1 <Transition> 1 0.25 <Transition> 2 0.25 <Transition> 3 0.25 <Transition> 4 0.25 </State> <State> 2 <PdfClass> 2 <Transition> 1 0.25 <Transition> 2 0.25 <Transition> 3 0.25 <Transition> 4 0.25 </State> <State> 3 <PdfClass> 3 <Transition> 1 0.25 <Transition> 2 0.25 <Transition> 3 0.25 <Transition> 4 0.25 </State> <State> 4 <PdfClass> 4 <Transition> 4 0.75 <Transition> 5 0.25 </State> <State> 5 </State> </TopologyEntry> </Topology>
続けて、decision tree(決定木)を作成する。
bin/build-tree treeacc roots.int questions.qst topo tree
(参考)インプットデータ「roots.int」
shared split 1 2 3 4 5 shared split 6 7 8 9 10 shared split 11 12 13 14 shared split 15 16 17 18 shared split 19 20 21 22 shared split 23 24 25 26
tree(説明用に加工したもの)
ContextDependency 3 :context-width 1 :central-position ToPdf SE 1 [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ]{ SE 1 [ 1 2 3 4 5 ]{ CE 0 SE 1 [ 6 7 8 9 10 ]{ CE 1 CE 2 } } SE 1 [ 15 16 17 18 ]{ CE 3 SE 1 [ 19 20 21 22 ]{ CE 4 CE 5 } } } EndContextDependency
treeを図示したもの。
緑字の角カッコ内はphone index、SE(SplitEventMap)のkeyの意味は以下のとおり。
- 0(left phone)
- 1(center phone)
- 2(right phone)
茶色がCE(ConstantEventMap)で、leafとなるpdf-idを示している。
作成した決定木をもとに、トライフォンの初期モデルを作成する。
gmm-init-model tree treeacc topo tri_0.mdl