Commit de03b4e8 authored by Jan Trmal's avatar Jan Trmal
Browse files

(trunk/rm) small fix and removing the scoring script as a preparation for...

(trunk/rm) small fix and removing the scoring script as a preparation for replacement with the kaldi default scoring script.


git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@4813 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent 47e0a735
......@@ -6,7 +6,7 @@
. cmd.sh
## SGMM on top of LDA+MLLT+SAT features.
if [ ! -f exp/ubm4a/final.ubm ] && [ ! data/train/feats.scp -nt exp/ubm4a/final.ubm ]; then
if [ ! -f exp/ubm4a/final.ubm ] || [ ! data/train/feats.scp -nt exp/ubm4a/final.ubm ]; then
steps/train_ubm.sh --silence-weight 0.5 --cmd "$train_cmd" 400 data/train data/lang exp/tri3b_ali exp/ubm4a || exit 1;
fi
......
#!/bin/bash
# Copyright 2012 Johns Hopkins University (Author: Daniel Povey)
# Apache 2.0
[ -f ./path.sh ] && . ./path.sh
cmd=run.pl
min_lmwt=2
max_lmwt=13
word_ins_penalty=0.0
#end configuration section.
[ -f ./path.sh ] && . ./path.sh
. parse_options.sh || exit 1;
if [ $# -ne 3 ]; then
echo "Usage: local/score.sh [--cmd (run.pl|queue.pl...)] <data-dir> <lang-dir|graph-dir> <decode-dir>"
echo " --min_lmwt <int> # minumum LM-weight for lattice rescoring "
echo " --max_lmwt <int> # maximum LM-weight for lattice rescoring "
exit 1;
fi
data=$1
lang_or_graph=$2
dir=$3
symtab=$lang_or_graph/words.txt
for f in $symtab $dir/lat.1.gz $data/text; do
[ ! -f $f ] && echo "score.sh: no such file $f" && exit 1;
done
mkdir -p $dir/scoring/log
$cmd LMWT=$min_lmwt:$max_lmwt $dir/scoring/log/best_path.LMWT.log \
lattice-scale --inv-acoustic-scale=LMWT "ark:gunzip -c $dir/lat.*.gz|" ark:- \| \
lattice-add-penalty --word-ins-penalty=$word_ins_penalty ark:- ark:- \| \
lattice-best-path --word-symbol-table=$symtab ark:- ark,t:$dir/scoring/LMWT.tra || exit 1;
# Note: the double level of quoting for the sed command
$cmd LMWT=$min_lmwt:$max_lmwt $dir/scoring/log/score.LMWT.log \
cat $dir/scoring/LMWT.tra \| \
utils/int2sym.pl -f 2- $symtab \| sed 's:\<UNK\>::g' \| \
compute-wer --text --mode=present \
ark:$data/text ark,p:- ">&" $dir/wer_LMWT || exit 1;
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