Commit 2de3389f authored by Jan Trmal's avatar Jan Trmal
Browse files

(trunk) The decode scripts now fail when the scoring fails. Added...

(trunk) The decode scripts now fail when the scoring fails. Added --skip-scoring switch to all of them to allow skipping the scoring alltogether, i.e. to avoid the decoding failure

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@5202 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent a5729f7b
......@@ -126,7 +126,8 @@ fi
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $scoring_opts $data $graphdir $dir
local/score.sh --cmd "$cmd" $scoring_opts $data $graphdir $dir ||
{ echo "$0: Scoring failedr. (ignore by '--skip-scoring true')"; exit 1; }
fi
exit 0;
......@@ -129,7 +129,8 @@ fi
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $scoring_opts $data $graphdir $dir
local/score.sh --cmd "$cmd" $scoring_opts $data $graphdir $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
exit 0;
......@@ -224,7 +224,8 @@ fi
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "$0: not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data $graphdir $dir
local/score.sh --cmd "$cmd" $data $graphdir $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
rm $dir/{trans_tmp,pre_trans}.*
......
......@@ -10,6 +10,7 @@ maxactive=7000
beam=13.0
lattice_beam=6.0
acwt=0.083333
skip_scoring=false
# End configuration.
echo "$0 $@" # Print the command line for logging
......@@ -80,8 +81,11 @@ $cmd JOB=1:$nj $dir/log/decode.JOB.log \
$srcdir/final.mdl $graphdir/HCLG.fst "$oldlm_cmd" "$newlm_cmd" "$feats" \
"ark:|gzip -c > $dir/lat.JOB.gz" || exit 1;
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data $graphdir $dir
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data $graphdir $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
exit 0;
......@@ -10,6 +10,7 @@
# Begin configuration section.
weight1=0.5 # Weight on 1st set of lattices.
cmd=run.pl
skip_scoring=false
# End configuration section.
echo "$0 $@" # Print the command line for logging
......@@ -54,8 +55,11 @@ $cmd JOB=1:$nj $dir/log/interp.JOB.log \
lattice-copy-backoff "ark,s,cs:gunzip -c $srcdir1/lat.JOB.gz|" ark,s,cs:- \
"ark:|gzip -c >$dir/lat.JOB.gz" || exit 1;
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data $lang_or_graphdir $dir
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data $lang_or_graphdir $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
exit 0;
......@@ -19,6 +19,7 @@ transform_dir=
num_threads=1 # if >1, will use gmm-latgen-faster-parallel
parallel_opts= # ignored now.
scoring_opts=
skip_scoring=false
# End configuration section.
echo "$0 $@" # Print the command line for logging
......@@ -104,8 +105,13 @@ if [ $stage -le 2 ]; then
fi
if [ $stage -le 3 ]; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh $scoring_opts --cmd "$cmd" $data $graphdir $dir
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $scoring_opts $data $graphdir $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
fi
exit 0;
......@@ -23,6 +23,7 @@ lattice_beam=7.0
acwt=0.083333
batch_size=75 # Limits memory blowup in compile-train-graphs-fsts
scale_opts="--transition-scale=1.0 --self-loop-scale=0.1"
skip_scoring=false
# End configuration.
echo "$0 $@" # Print the command line for logging
......@@ -84,8 +85,11 @@ $cmd JOB=1:$nj $dir/log/decode_lats.JOB.log \
--allow-partial=true --word-symbol-table=$lang/words.txt \
$srcdir/final.mdl ark:- "$feats" "ark:|gzip -c > $dir/lat.JOB.gz" || exit 1;
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data $lang $dir
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data $lang $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
exit 0;
......@@ -18,6 +18,7 @@ acwt=0.083333 # note: only really affects pruning (scoring is on lattices).
extra_beam=0.0 # small additional beam over varying beam
max_beam=100.0 # maximum of varying beam
scoring_opts=
skip_scoring=false
# End configuration section.
echo "$0 $@" # Print the command line for logging
......@@ -119,9 +120,12 @@ else
$model $graphdir/HCLG.fst "$feats" "ark:|gzip -c > $dir/lat.JOB.gz" || exit 1;
fi
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh $scoring_opts --cmd "$cmd" --reverse $reverse $scoring_opts $data $graphdir $dir
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh $scoring_opts --cmd "$cmd" --reverse $reverse $scoring_opts $data $graphdir $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
echo "Decoding done."
exit 0;
......@@ -31,7 +31,7 @@ vecs_beam=4.0 # Beam we use to prune lattices while getting posteriors for
use_fmllr=false
fmllr_iters=10
fmllr_min_count=1000
skip_scoring=false
# End configuration section.
echo "$0 $@" # Print the command line for logging
......@@ -252,12 +252,15 @@ fi
if [ $stage -le 7 ]; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
echo "score best paths"
local/score.sh --cmd "$cmd" $data $graphdir $dir
echo "score confidence and timing with sclite"
#local/score_sclite_conf.sh --cmd "$cmd" --language turkish $data $graphdir $dir
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
echo "score best paths"
local/score.sh --cmd "$cmd" $data $graphdir $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
#echo "score confidence and timing with sclite"
#local/score_sclite_conf.sh --cmd "$cmd" --language turkish $data $graphdir $dir
fi
fi
echo "Decoding done."
exit 0;
......@@ -34,7 +34,7 @@ use_fmllr=false
fmllr_iters=10
fmllr_min_count=1000
scale_opts="--transition-scale=1.0 --self-loop-scale=0.1"
skip_scoring=false
# End configuration section.
echo "$0 $@" # Print the command line for logging
......@@ -260,12 +260,13 @@ fi
if [ $stage -le 7 ]; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
echo "score best paths"
local/score.sh --cmd "$cmd" $data $lang $dir
echo "score confidence and timing with sclite"
#local/score_sclite_conf.sh --cmd "$cmd" --language turkish $data $lang $dir
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
echo "score best paths"
local/score.sh --cmd "$cmd" $data $lang $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
fi
echo "Decoding done."
exit 0;
......@@ -103,10 +103,11 @@ $cmd JOB=1:$nj $dir/log/rescore.JOB.log \
$srcdir/$iter.mdl "ark:gunzip -c $olddir/lat.JOB.gz|" "$feats" \
"ark:|gzip -c > $dir/lat.JOB.gz" || exit 1;
if ! $skip_scoring ; then
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh $scoring_opts --cmd "$cmd" $data $graphdir $dir
local/score.sh $scoring_opts --cmd "$cmd" $data $graphdir $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
exit 0;
......@@ -25,6 +25,7 @@ cmd=run.pl
iter=final
prob_scale=-0.25
dimensions=0:13:104:117
skip_scoring=false
# End configuration section.
echo "$0 $@" # Print the command line for logging
......@@ -166,8 +167,11 @@ fi
rm $dir/lat.{left,right}.*.gz 2>/dev/null # note: if these still exist, it will
# confuse the scoring script.
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data $graphdir $dir
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data $graphdir $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
exit 0;
......@@ -37,7 +37,7 @@ use_fmllr=false
fmllr_iters=10
fmllr_min_count=1000
scale_opts="--transition-scale=1.0 --self-loop-scale=0.1"
skip_scoring=false
# End configuration section.
echo "$0 $@" # Print the command line for logging
......@@ -263,12 +263,15 @@ fi
if [ $stage -le 7 ]; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
echo "score best paths"
local/score.sh --cmd "$cmd" $data $lang $dir
echo "score confidence and timing with sclite"
#local/score_sclite_conf.sh --cmd "$cmd" --language turkish $data $lang $dir
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
echo "score best paths"
local/score.sh --cmd "$cmd" $data $lang $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
# echo "score confidence and timing with sclite"
# local/score_sclite_conf.sh --cmd "$cmd" --language turkish $data $lang $dir
fi
fi
echo "Decoding done."
exit 0;
......@@ -20,6 +20,7 @@ weight_tau=10
flags=mw # could also contain "v" for variance; the default
# tau for that is 50.
stage=1
skip_scoring=false
# End configuration section.
[ -f ./path.sh ] && . ./path.sh; # source the path.
......@@ -107,8 +108,11 @@ fi
#rm -f $dir/pass1_decode.*.ali
#rm -f $dir/tmp.*.tra
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data $graphdir $dir
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data $graphdir $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
exit 0;
......@@ -14,7 +14,7 @@ use_phi=false # This is kind of an obscure option. If true, we'll remove the o
test=false # Activate a testing option.
stage=1 # Stage of this script, for partial reruns.
rnnlm_ver=rnnlm-0.3e
skip_scoring=true
skip_scoring=false
keep_ali=true
# End configuration section.
......@@ -204,7 +204,8 @@ fi
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data $oldlang $dir
local/score.sh --cmd "$cmd" $data $oldlang $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
exit 0;
......
......@@ -15,6 +15,7 @@ lattice_beam=6.0
acwt=0.083333 # note: only really affects pruning (scoring is on lattices).
min_lmwt=9
max_lmwt=20
skip_scoring=false
# End configuration section.
echo "$0 $@" # Print the command line for logging
......@@ -136,8 +137,11 @@ $cmd JOB=1:$nj $dir/log/decode.JOB.log \
--acoustic-scale=$acwt --allow-partial=true --word-symbol-table=$graphdir/words.txt \
$model $graphdir/HCLG.fst "$feats" "ark:|gzip -c > $dir/lat.JOB.gz" || exit 1;
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" --min_lmwt $min_lmwt --max_lmwt $max_lmwt $data1 $graphdir $dir
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" --min_lmwt $min_lmwt --max_lmwt $max_lmwt $data1 $graphdir $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
exit 0;
......@@ -42,6 +42,7 @@ silence_weight=0.01
cmd=run.pl
si_dir=
fmllr_update_type=full
skip_scoring=false
# End configuration section
echo "$0 $@" # Print the command line for logging
......@@ -232,9 +233,12 @@ if [ $stage -le 4 ]; then
"ark:|gzip -c > $dir/lat.JOB.gz" '&&' rm $dir/lat.tmp.JOB.gz || exit 1;
fi
[ ! -x local/score.sh ] && \
echo "$0: not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data1 $graphdir $dir
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "$0: not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data1 $graphdir $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
rm $dir/{trans_tmp,pre_trans}.*
......
......@@ -32,7 +32,7 @@ vecs_beam=4.0 # Beam we use to prune lattices while getting posteriors for
use_fmllr=false
fmllr_iters=10
fmllr_min_count=1000
skip_scoring=false
# End configuration section.
echo "$0 $@" # Print the command line for logging
......@@ -289,12 +289,15 @@ fi
if [ $stage -le 7 ]; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
echo "score best paths"
local/score.sh --cmd "$cmd" $data $graphdir $dir
echo "score confidence and timing with sclite"
#local/score_sclite_conf.sh --cmd "$cmd" --language turkish $data $graphdir $dir
if ! $skip_scoring ; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
echo "score best paths"
local/score.sh --cmd "$cmd" $data $graphdir $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
# echo "score confidence and timing with sclite"
# local/score_sclite_conf.sh --cmd "$cmd" --language turkish $data $graphdir $dir
fi
fi
echo "Decoding done."
exit 0;
......@@ -31,6 +31,7 @@ vecs_beam=4.0 # Beam we use to prune lattices while getting posteriors for
use_fmllr=false
fmllr_iters=10
fmllr_min_count=1000
skip_scoring=false
# End configuration section.
echo "$0 $@" # Print the command line for logging
......@@ -227,10 +228,13 @@ rm $dir/pre_lat.*.gz
# The output of this script is the files "lat.*.gz"-- we'll rescore this at different
# acoustic scales to get the final output.
if [ $stage -le 7 ]; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data1 $graphdir $dir
if ! $skip_scoring ; then
if [ $stage -le 7 ]; then
[ ! -x local/score.sh ] && \
echo "Not scoring because local/score.sh does not exist or not executable." && exit 1;
local/score.sh --cmd "$cmd" $data1 $graphdir $dir ||
{ echo "$0: Scoring failed. (ignore by '--skip-scoring true')"; exit 1; }
fi
fi
exit 0;
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