Fix various problems with latrescore.sh

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@273 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
This commit is contained in:
Dan Povey 2011-08-15 14:58:36 +00:00
Родитель 6b17306400
Коммит ac30061778
2 изменённых файлов: 10 добавлений и 7 удалений

Просмотреть файл

@ -216,9 +216,9 @@ steps/train_tri2a.sh || exit 1;
for year in 92 93; do
scripts/decode.sh exp/decode_tri2a_bg_eval${year} exp/graph_tri2a_bg/HCLG.fst steps/decode_tri2a.sh data/eval_nov${year}.scp
scripts/decode.sh exp/decode_tri2a_bg_latgen_eval${year} exp/graph_tri2a_bg/HCLG.fst steps/decode_tri2a_latgen.sh data/eval_nov${year}.scp
scripts/latrescore.sh exp/decode_tri2a_bg_latgen_eval${year} data/G_bg.fst data/G_tg.fst exp/decode_tri2a_bg_rescore_tg data/eval_nov${year}.txt
scripts/latrescore.sh exp/decode_tri2a_bg_latgen_eval${year} data/G_bg.fst data/G_tg_pruned.fst exp/decode_tri2a_bg_rescore_tg_pruned data/eval_nov${year}.txt
scripts/latrescore.sh exp/decode_tri2a_bg_latgen_eval${year} data/G_bg.fst data/G_bg.fst exp/decode_tri2a_bg_rescore_bg data/eval_nov${year}.txt
scripts/latrescore.sh exp/decode_tri2a_bg_latgen_eval${year} data/G_bg.fst data/G_tg.fst data/eval_nov${year}.txt exp/decode_tri2a_bg_rescore_tg
scripts/latrescore.sh exp/decode_tri2a_bg_latgen_eval${year} data/G_bg.fst data/G_tg_pruned.fst data/eval_nov${year}.txt exp/decode_tri2a_bg_rescore_tg_pruned
scripts/latrescore.sh exp/decode_tri2a_bg_latgen_eval${year} data/G_bg.fst data/G_bg.fst data/eval_nov${year}.txt exp/decode_tri2a_bg_rescore_bg
done
)&

Просмотреть файл

@ -30,19 +30,22 @@ newlm=$3
transcript=$4 # e.g. data/eval_nov92.txt
dir=$5
mkdir -p $dir # create output decode dir if not yet existing
oldlmcommand="fstproject --project_output=true $oldlm |"
newlmcommand="fstproject --project_output=true $newlm |"
mkdir -p $dir
# First remove the old LM scores.
lattice-lmrescore --lm-scale=-1.0 "ark:gunzip -c $inputdir/*.lats.gz|" $oldlm \
lattice-lmrescore --lm-scale=-1.0 "ark:gunzip -c $inputdir/*.lats.gz|" "$oldlmcommand" \
ark:- 2>$dir/remove_old_lm.log | \
lattice-lmrescore --lm-scale=1.0 ark:- $newlm "ark,t:gzip -c>$dir/lats.newlm.gz" \
lattice-lmrescore --lm-scale=1.0 ark:- "$newlmcommand" "ark,t:|gzip -c>$dir/lats.newlm.gz" \
2>$dir/add_new_lm.log
for inv_acwt in 14 15 16 17 18; do
acwt=`perl -e "print (1.0/$inv_acwt);"`;
lattice-best-path --acwt=$acwt --word-symbol-table=data/words.txt \
lattice-best-path --acoustic-scale=$acwt --word-symbol-table=data/words.txt \
"ark:gunzip -c $dir/lats.newlm.gz|" ark:$dir/acwt${inv_acwt}.tra \
2>$dir/best_path.$inv_acwt.log
scripts/sym2int.pl --ignore-first-field data/words.txt $transcript | \