kaldi常见文件查看方式

  |   0 评论   |   0 浏览

ark 文件

ark存的是二进制文件,使用copy-feats查看。

% ~/git/kaldi/src/featbin/copy-feats ark:./mfcc/raw_mfcc_train_yesno.1.ark ark,t: | head
/Users/abeffect/git/kaldi/src/featbin/copy-feats ark:./mfcc/raw_mfcc_train_yesno.1.ark ark,t:
0_0_0_0_1_1_1_1  [
  49.18987 -14.31374 -0.04487864 4.029026 22.31584 -1.851196 -6.489287 7.53463 3.589755 16.72902 2.288574 7.840806 3.685221
  53.64615 -10.05501 -1.699008 -1.522405 12.77514 6.441048 8.669569 19.26073 1.308352 5.30587 2.288574 2.310097 -0.2609844
  55.37115 -10.05501 2.141454 5.659564 18.16771 0.001552582 -6.22876 6.537532 6.124648 4.891899 0.7174129 4.477045 5.838462
  56.52116 -16.4431 -2.214904 7.765487 4.893689 5.353939 -13.13274 3.053869 11.03517 17.89594 -5.11833 2.652246 5.300152
  59.04275 -6.313772 -3.956053 -4.468062 1.973291 7.616046 -3.232693 -2.903994 -2.367242 12.06137 -23.10472 5.389444 -2.832414
  61.00124 -5.667281 -2.859774 -2.202172 9.456634 6.441048 3.541023 5.651222 6.758371 13.22829 -2.649362 -3.734549 -11.62397
  61.16445 -6.637018 -3.698105 -1.635699 1.132528 1.236717 1.196276 2.681503 5.237435 14.10347 -2.200459 -0.0849514 3.685221
  61.98048 -7.121886 -1.827981 2.442904 1.973291 7.028547 -8.052452 -2.903994 2.322309 7.996674 -4.220523 9.503203 -4.832415
  60.51162 -6.798641 -2.408365 -1.295815 4.064063 2.471884 -6.880079 10.19356 5.36418 6.961748 -2.986039 6.653379 -3.689557

scp 文件

scp是文本文件,如 wav.scp

% cat ./data/test_yesno/wav.scp
1_0_0_0_0_0_0_0 waves_yesno/1_0_0_0_0_0_0_0.wav
1_0_0_0_0_0_0_1 waves_yesno/1_0_0_0_0_0_0_1.wav
1_0_0_0_0_0_1_1 waves_yesno/1_0_0_0_0_0_1_1.wav
1_0_0_0_1_0_0_1 waves_yesno/1_0_0_0_1_0_0_1.wav

fst 文件

fstprint

% ~/git/kaldi/tools/openfst-1.6.7/bin/fstprint ./data/lang/L.fst
0	1	0	0	0.693147182
0	2	0	0	0.693147182
1	1	1	1	0.693147182
1	2	1	1	0.693147182
1	1	3	2	0.693147182
1	2	3	2	0.693147182
1	1	2	3	0.693147182
1	2	2	3	0.693147182
1
2	1	1	0
% ~/git/kaldi/tools/openfst-1.6.7/bin/fstprint --isymbols=./data/lang/phones.txt --osymbols=./data/lang/words.txt ./data/lang/L.fst
0	1	<eps>	<eps>	0.693147182
0	2	<eps>	<eps>	0.693147182
1	1	SIL	<SIL>	0.693147182
1	2	SIL	<SIL>	0.693147182
1	1	N	NO	0.693147182
1	2	N	NO	0.693147182
1	1	Y	YES	0.693147182
1	2	Y	YES	0.693147182
1
2	1	SIL	<eps>

fstdraw

~/git/kaldi/tools/openfst-1.6.7/bin/fstdraw  --isymbols=./data/lang/phones.txt --osymbols=./data/lang/words.txt ./data/lang/L.fst | dot -T ps > l.ps
open l.ps
~/git/kaldi/tools/openfst-1.6.7/bin/fstdraw ./exp/mono0a/graph_tgpr/HCLG.fst | dot -T ps > hclg.ps
open hclg.ps

mfcc生成的文件

ark文件

% ~/git/kaldi/src/featbin/copy-feats ark:./mfcc/cmvn_train_yesno.ark ark,t:  
/Users/abeffect/git/kaldi/src/featbin/copy-feats ark:./mfcc/cmvn_train_yesno.ark ark,t:  
global  [  
 1303126 41530.71 -63424.14 -89995.28 -211870.1 -145302.4 -76859.43 224256 35697.05 -31621.26 -54304.32 -34806.42 -79045.66 18996  
 9.19177e+07 2527505 1448328 3521545 9168808 7489244 4859754 4892703 4397816 5298388 2523146 2211527 1972313 0 ]  
LOG (copy-feats[5.5.537~3-e2c0]:main():copy-feats.cc:143) Copied 1 feature matrices.  

scp文本文件:cmvn_xxx.scp

cat ./mfcc/cmvn_train_yesno.scp  
global /Users/abeffect/git/kaldi/egs/yesno/s5/mfcc/cmvn_train_yesno.ark:7  

mdl 文件

% ~/git/kaldi/src/gmmbin/gmm-copy --binary=false ./exp/mono0a/0.mdl - | head
/Users/abeffect/git/kaldi/src/gmmbin/gmm-copy --binary=false ./exp/mono0a/0.mdl -
LOG (gmm-copy[5.5.537~3-e2c0]:main():gmm-copy.cc:75) Written model to -
<TransitionModel>
<Topology>
<TopologyEntry>
<ForPhones>
2 3
</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>

tree 文件

% ~/git/kaldi/src/bin/copy-tree --binary=false ./exp/mono0a/tree -
/Users/abeffect/git/kaldi/src/bin/copy-tree --binary=false ./exp/mono0a/tree -
ContextDependency 1 0 ToPdf TE 0 4 ( NULL TE -1 5 ( CE 0 CE 1 CE 2 CE 3 CE 4 )
TE -1 3 ( CE 5 CE 6 CE 7 )
TE -1 3 ( CE 8 CE 9 CE 10 )
)
EndContextDependency LOG (copy-tree[5.5.537~3-e2c0]:main():copy-tree.cc:55) Copied tree
 % ~/git/kaldi/src/bin/draw-tree data/lang/phones.txt ./exp/mono0a/tree  | dot -Gsize=50,100 -Tps > tree.ps
/Users/abeffect/git/kaldi/src/bin/draw-tree data/lang/phones.txt ./exp/mono0a/tree
% open tree.ps

ali.1.gz 对齐文件

% ~/git/kaldi/src/bin/copy-int-vector "ark:gunzip -c ./exp/mono0a/ali.1.gz|" ark,t:- |head -n 1
/Users/abeffect/git/kaldi/src/bin/copy-int-vector 'ark:gunzip -c ./exp/mono0a/ali.1.gz|' ark,t:-
0_0_0_0_1_1_1_1 4 16 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 18 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 26 28 27 27 27 27 27 27 27 27 27 27 30 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 2 1 1 1 1 1 1 1 1 1 1 1 1 1 8 5 5 5 5 5 18 26 28 27 27 27 27 27 27 27 27 27 27 27 27 27 27 30 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 5 5 5 5 5 5 5 5 5 18 26 28 27 27 27 27 27 27 27 27 27 27 27 27 27 27 30 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 2 1 1 1 1 1 1 1 1 1 1 1 1 8 5 5 5 5 5 5 5 5 5 18 26 28 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 30 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 2 1 1 1 1 1 1 1 1 1 1 1 1 8 5 5 5 5 5 5 5 5 5 5 5 5 5 18 17 17 17 17 17 17 20 19 19 19 19 19 19 19 19 19 19 19 22 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 24 23 23 23 23 23 23 23 23 23 23 2 8 5 5 5 5 5 5 18 17 17 17 17 17 17 17 17 20 19 19 19 19 19 19 19 19 19 19 19 19 22 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 24 23 23 23 23 23 23 23 23 23 23 23 2 8 5 5 5 5 5 5 5 5 5 18 17 17 17 17 17 17 17 17 17 20 19 19 19 19 19 19 19 19 19 19 19 19 22 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 24 23 23 23 23 23 23 23 23 23 23 23 2 1 1 8 5 5 5 5 5 5 5 5 5 18 17 17 17 17 17 17 17 17 17 17 17 20 19 19 19 19 19 19 19 19 19 19 22 21 21 21 21 21 21 21 21 21 21 21 21 24 23 23 23 23 23 23 23 23 23 23 23 2 1 7 5 5 5 5 5 5 5 14 15 15 15 15 15 15 15 15 15 15 15 15 11 10 10 10 10 10 10 16 15 15 15 15 15 15 18 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17
gzip -d ./exp/mono0a/ali.1.gz
./exp/mono0a/ali.1.gz

 % ~/git/kaldi/src/bin/show-alignments data/lang/phones.txt ./exp/mono0a/40.mdl ark:./exp/mono0a/ali.1 | head -n 2
/Users/abeffect/git/kaldi/src/bin/show-alignments data/lang/phones.txt ./exp/mono0a/40.mdl ark:./exp/mono0a/ali.1
0_0_0_0_1_1_1_1  [ 4 16 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 18 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 ] [ 26 28 27 27 27 27 27 27 27 27 27 27 30 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 ] [ 2 1 1 1 1 1 1 1 1 1 1 1 1 1 8 5 5 5 5 5 18 ] [ 26 28 27 27 27 27 27 27 27 27 27 27 27 27 27 27 30 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 ] [ 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 5 5 5 5 5 5 5 5 5 18 ] [ 26 28 27 27 27 27 27 27 27 27 27 27 27 27 27 27 30 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 ] [ 2 1 1 1 1 1 1 1 1 1 1 1 1 8 5 5 5 5 5 5 5 5 5 18 ] [ 26 28 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 30 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 ] [ 2 1 1 1 1 1 1 1 1 1 1 1 1 8 5 5 5 5 5 5 5 5 5 5 5 5 5 18 17 17 17 17 17 17 ] [ 20 19 19 19 19 19 19 19 19 19 19 19 22 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 24 23 23 23 23 23 23 23 23 23 23 ] [ 2 8 5 5 5 5 5 5 18 17 17 17 17 17 17 17 17 ] [ 20 19 19 19 19 19 19 19 19 19 19 19 19 22 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 24 23 23 23 23 23 23 23 23 23 23 23 ] [ 2 8 5 5 5 5 5 5 5 5 5 18 17 17 17 17 17 17 17 17 17 ] [ 20 19 19 19 19 19 19 19 19 19 19 19 19 22 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 24 23 23 23 23 23 23 23 23 23 23 23 ] [ 2 1 1 8 5 5 5 5 5 5 5 5 5 18 17 17 17 17 17 17 17 17 17 17 17 ] [ 20 19 19 19 19 19 19 19 19 19 19 22 21 21 21 21 21 21 21 21 21 21 21 21 24 23 23 23 23 23 23 23 23 23 23 23 ] [ 2 1 7 5 5 5 5 5 5 5 14 15 15 15 15 15 15 15 15 15 15 15 15 11 10 10 10 10 10 10 16 15 15 15 15 15 15 18 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 ]
0_0_0_0_1_1_1_1  SIL                                                                                                                                                                                                                                                               N                                                                                                      SIL                                            N                                                                                                            SIL                                                      N                                                                                                            SIL                                                  N                                                                                                                  SIL                                                                            Y                                                                                                                                    SIL                                            Y                                                                                                                                          SIL                                                     Y                                                                                                                                 SIL                                                               Y                                                                                                               SIL

参考