Commit a89ff929 authored by Dan Povey's avatar Dan Povey
Browse files

Adding boosting option to MMI script.

git-svn-id: https://svn.code.sf.net/p/kaldi/code/sandbox/discrim@482 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent ded57d4f
...@@ -104,6 +104,11 @@ steps/align_lda_mllt.sh --graphs "ark,s,cs:gunzip -c exp/tri2b/graphs.fsts.gz|" ...@@ -104,6 +104,11 @@ steps/align_lda_mllt.sh --graphs "ark,s,cs:gunzip -c exp/tri2b/graphs.fsts.gz|"
steps/train_lda_etc_mmi.sh data/train data/lang exp/tri2b_ali exp/tri3a & steps/train_lda_etc_mmi.sh data/train data/lang exp/tri2b_ali exp/tri3a &
local/decode.sh steps/decode_lda_mllt.sh exp/tri3a/decode local/decode.sh steps/decode_lda_mllt.sh exp/tri3a/decode
# Do the same with boosting.
steps/train_lda_etc_mmi.sh --boost 0.05 data/train data/lang exp/tri2b_ali exp/tri3b &
local/decode.sh steps/decode_lda_mllt.sh exp/tri3a/decode
# Do LDA+MLLT+SAT # Do LDA+MLLT+SAT
steps/train_lda_mllt_sat.sh data/train data/lang exp/tri2b_ali exp/tri3d steps/train_lda_mllt_sat.sh data/train data/lang exp/tri2b_ali exp/tri3d
local/decode.sh steps/decode_lda_mllt_sat.sh exp/tri3d/decode local/decode.sh steps/decode_lda_mllt_sat.sh exp/tri3d/decode
...@@ -156,7 +161,7 @@ local/decode.sh steps/decode_sgmm_lda_etc_fmllr.sh exp/sgmm4f/decode_fmllr exp/s ...@@ -156,7 +161,7 @@ local/decode.sh steps/decode_sgmm_lda_etc_fmllr.sh exp/sgmm4f/decode_fmllr exp/s
local/decode_combine.sh steps/decode_combine.sh exp/tri1/decode exp/tri2a/decode exp/combine_1_2a/decode local/decode_combine.sh steps/decode_combine.sh exp/tri1/decode exp/tri2a/decode exp/combine_1_2a/decode
local/decode_combine.sh steps/decode_combine.sh exp/sgmm4f/decode/ exp/tri3d/decode exp/combine_sgmm4f_tri3d/decode local/decode_combine.sh steps/decode_combine.sh exp/sgmm4f/decode/ exp/tri3d/decode exp/combine_sgmm4f_tri3d/decode
for x in exp/*/decode*; do grep WER $x/wer_* | scripts/best_wer.sh; done for x in exp/*/decode*; do [ -d $x ] && grep WER $x/wer_* | scripts/best_wer.sh; done
exp/combine_1_2a/decode/wer_7:%WER 3.399027 [ 426 / 12533, 55 ins, 94 del, 277 sub ] exp/combine_1_2a/decode/wer_7:%WER 3.399027 [ 426 / 12533, 55 ins, 94 del, 277 sub ]
exp/combine_sgmm4f_tri3d/decode/wer_5:%WER 1.731429 [ 217 / 12533, 30 ins, 43 del, 144 sub ] exp/combine_sgmm4f_tri3d/decode/wer_5:%WER 1.731429 [ 217 / 12533, 30 ins, 43 del, 144 sub ]
......
...@@ -26,6 +26,12 @@ ...@@ -26,6 +26,12 @@
# alignments, models and transforms from an LDA+MLLT system: # alignments, models and transforms from an LDA+MLLT system:
# ali, final.mdl, final.mat # ali, final.mdl, final.mat
b=0 # boosting constant, for boosted MMI.
if [ $1 == "--boost" ]; then # e.g. "--boost 0.05"
shift;
b=$1;
shift;
fi
if [ $# != 4 ]; then if [ $# != 4 ]; then
echo "Usage: steps/train_lda_etc_mmi.sh <data-dir> <lang-dir> <ali-dir> <exp-dir>" echo "Usage: steps/train_lda_etc_mmi.sh <data-dir> <lang-dir> <ali-dir> <exp-dir>"
...@@ -45,6 +51,7 @@ acwt=0.1 ...@@ -45,6 +51,7 @@ acwt=0.1
beam=20 beam=20
latticebeam=10 latticebeam=10
scale_opts="--transition-scale=1.0 --acoustic-scale=0.1 --self-loop-scale=0.1" scale_opts="--transition-scale=1.0 --acoustic-scale=0.1 --self-loop-scale=0.1"
silphonelist=`cat $lang/silphones.csl`
mkdir -p $dir mkdir -p $dir
cp $alidir/tree $alidir/final.mat $dir # Will use the same tree and transforms as in the baseline. cp $alidir/tree $alidir/final.mat $dir # Will use the same tree and transforms as in the baseline.
...@@ -95,8 +102,9 @@ rm $dir/.error 2>/dev/null ...@@ -95,8 +102,9 @@ rm $dir/.error 2>/dev/null
for n in 0 1 2 3; do for n in 0 1 2 3; do
gmm-latgen-simple --beam=$beam --lattice-beam=$latticebeam --acoustic-scale=$acwt \ gmm-latgen-simple --beam=$beam --lattice-beam=$latticebeam --acoustic-scale=$acwt \
--word-symbol-table=$lang/words.txt \ --word-symbol-table=$lang/words.txt \
$alidir/final.mdl $dir/dgraph/HCLG.fst "${featspart[$n]}" "ark:|gzip -c >$dir/lat$n.gz" \ $alidir/final.mdl $dir/dgraph/HCLG.fst "${featspart[$n]}" \
2>$dir/decode_den.$n.log || touch $dir/.error & "ark:|lattice-boost-ali --b=$b --silence-phones=$silphonelist $alidir/final.mdl ark:- ark,s,cs:$alidir/ali ark:- | gzip -c >$dir/lat$n.gz" \
2>$dir/decode_den.$n.log || touch $dir/.error &
done done
wait wait
if [ -f $dir/.error ]; then if [ -f $dir/.error ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment