www.pudn.com > sphinx_recipe.zip > eval.sh
# Evaluates Sphinx models on some test set.
#
# Uses the specified base config file for paramemter settings.
# After the unique name parameter, all others are name/value
# pairs that are sent in to create the config file.
#
# Parameters:
# $1 - config filename
# $2 - unique name for this run
# $3/$4 - first name value pair
# ...
# Decide if we should use the Sphinx-3 or Sphinx-2 decoding script
DECODER=`perl $CMU_SCRIPTS/GetFromConfig.pl $1 DECODER`
# Find out how long this test set is so we can compute xRT
TEST_SET_SECONDS=`perl $CMU_SCRIPTS/GetFromConfig.pl $1 TEST_SET_SECONDS`
if [[ $DECODER == "sphinx2" ]]
then
DECODE_SCRIPT=s2slave.pl
echo "Decoding using Sphinx-2..."
else
if [[ $DECODER == "pocketsphinx" ]]
then
DECODE_SCRIPT=pocketslave.pl
echo "Decoding using PocketSphinx..."
else
DECODE_SCRIPT=s3slave.pl
echo "Decoding using Sphinx-3..."
fi
fi
# We put each run into a separate result directory
mkdir -p result_$2
# Create a temporary config file using the template and
# replacing the __VARIABLES__ with what we need for
# this run. Tack on any command line name/value pairs.
perl $CMU_SCRIPTS/CreateConfig.pl etc/decode_template.cfg $1 RESULT_DIR_SUFFIX _$2 ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20} ${21} ${22} ${23} ${24} ${25} ${26} ${27} ${28} ${29} ${30} ${31} ${32} ${33} ${34} ${35} ${36} ${37} ${38} ${39} ${40} >etc/temp_$2.cfg
perl $CMU_SCRIPTS/TimeJob.pl start temp_nov92_$2.txt
perl scripts_pl/decode/$DECODE_SCRIPT -cfg etc/temp_$2.cfg >eval_$2.log
perl $CMU_SCRIPTS/TimeJob.pl stop temp_nov92_$2.txt $TEST_SET_SECONDS >>eval_$2.log
rm -f etc/temp_$2.cfg
rm -f temp_nov92_$2.txt