Skip to content

Commit

Permalink
some cosmetic changes: add comments to RNNLM rescoring utilities to r…
Browse files Browse the repository at this point in the history
…efer to each other; improve messages printed out by 'configure'
  • Loading branch information
danpovey committed May 4, 2016
1 parent c1d049e commit 50aca0a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion egs/wsj/s5/steps/lmrescore_rnnlm_lat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# Copyright 2015 Guoguo Chen
# Apache 2.0

# This script rescores lattices with RNNLM.
# This script rescores lattices with RNNLM. See also rnnlmrescore.sh which is
# an older script using n-best lists.

# Begin configuration section.
cmd=run.pl
Expand Down
7 changes: 4 additions & 3 deletions egs/wsj/s5/steps/rnnlmrescore.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

# please see lmrescore_rnnlm_lat.sh which is a newer script using lattices.

# Begin configuration section.
N=10
Expand Down Expand Up @@ -104,14 +105,14 @@ if [ "$oldlm" == "$oldlang/G.fst" ]; then
if [ $stage -le 2 ]; then
echo "$0: removing old LM scores."
# Use the phi-matcher style of composition.. this is appropriate
# if the old LM scores were added e.g. by lmrescore.sh, using
# if the old LM scores were added e.g. by lmrescore.sh, using
# phi-matcher composition.
$cmd JOB=1:$nj $dir/log/remove_old.JOB.log \
lattice-scale --acoustic-scale=-1 --lm-scale=-1 "ark:gunzip -c $dir/nbest1.JOB.gz|" ark:- \| \
lattice-compose --phi-label=$phi ark:- $oldlm ark:- \| \
lattice-scale --acoustic-scale=-1 --lm-scale=-1 ark:- "ark:|gzip -c >$dir/nbest2.JOB.gz" \
|| exit 1;
fi
fi
else
if [ $stage -le 2 ]; then
echo "$0: removing old LM scores."
Expand Down Expand Up @@ -189,7 +190,7 @@ if [ $stage -le 7 ]; then
echo "$0: reconstructing total LM+graph scores including interpolation of RNNLM and old LM scores."
for n in `seq $nj`; do
paste $adir.$n/lmwt.nolm $adir.$n/lmwt.lmonly $adir.$n/lmwt.rnn | awk -v rnnweight=$rnnweight \
'{ key=$1; graphscore=$2; lmscore=$4; rnnscore=$6;
'{ key=$1; graphscore=$2; lmscore=$4; rnnscore=$6;
score = graphscore+(rnnweight*rnnscore)+((1-rnnweight)*lmscore);
print $1,score; } ' > $adir.$n/lmwt.interp.$rnnweight || exit 1;
done
Expand Down
7 changes: 4 additions & 3 deletions src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ function configure_cuda {
# Determine 'CUDA_ARCH',
CUDA_VERSION=$($CUDATKDIR/bin/nvcc -V | tr '.,' '_ ' | awk '/release/{sub(/.*release/,""); print $1;}') # MAJOR_MINOR,
if [ -z "$CUDA_VERSION" ] ; then
echo "Cannot figure out CUDA_VERSION from the nvcc output. Either your CUDA is too new or too old."
echo "Cannot figure out CUDA_VERSION from the nvcc output. Either your CUDA is too new or too old."
exit 1
fi

Expand Down Expand Up @@ -474,7 +474,8 @@ function linux_configure_speex {
spx_type=so
fi
if [ ! -f "$SPEEXROOT/lib/libspeex.${spx_type}" ];then
echo "Static=[$static_speex] Speex library not found: You can still build Kaldi without Speex."
echo "Info: configuring Kaldi not to link with Speex (don't worry, it's only needed if you"
echo "intend to use 'compress-uncompress-speex', which is very unlikely)"
return
fi

Expand Down Expand Up @@ -715,7 +716,7 @@ function linux_check_dynamic {
return 0;
fi
done
echo "... no {libatlas,lib${pt}atlas}.so in $dir";
# echo "... no {libatlas,lib${pt}atlas}.so in $dir";
return 1;
}

Expand Down

0 comments on commit 50aca0a

Please sign in to comment.