Skip to content

Commit 4566a3e

Browse files
hainan-xvdanpovey
authored andcommitted
[egs] add example script for RNNLM lattice rescoring for WSJ recipe (#2727)
1 parent 69cd717 commit 4566a3e

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tuning/run_lstm_tdnn_1b.sh

egs/wsj/s5/local/rnnlm/tuning/run_lstm_tdnn_1b.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,18 @@
99
# Train objf: -1038.00 -5.35 -5.04 -4.87 -4.76 -4.68 -4.61 -4.56 -4.52 -4.47 -4.44 -4.41 -4.37 -4.35 -4.33 -4.31 -4.29 -4.27 -4.25 -4.24 -4.23 -4.21 -4.19 -4.17 -4.16 -4.15 -4.13 -4.12 -4.11 -4.10 -4.09 -4.07 -4.07 -4.06 -4.05 -4.04 -4.03 -4.02 -4.01 -4.00 -3.99 -3.98 -3.98 -3.97 -3.96 -3.96 -3.95 -3.94 -3.93 -3.93 -3.92 -3.92 -3.91 -3.91 -3.90 -3.90 -3.89 -3.88 -3.88 -3.88 -3.88 -3.88 -3.86 -3.86 -3.85 -3.85 -3.84 -3.83 -3.83 -3.83 -3.82 -3.82 -3.81 -3.81 -3.80 -3.80 -3.79 -3.79 -3.79 -3.79
1010
# Dev objf: -11.73 -5.66 -5.18 -4.96 -4.82 -4.73 -4.66 -4.59 -4.54 -4.51 -4.47 -4.44 -4.40 -4.38 -4.36 -4.34 -4.32 -4.30 -4.28 -4.27 -4.26 -4.21 -4.19 -4.18 -4.16 -4.15 -4.14 -4.13 -4.12 -4.12 -4.11 -4.09 -4.09 -4.08 -4.07 -4.07 -4.06 -4.06 -4.05 -4.04 -4.04 -4.04 -4.03 -4.02 -4.02 -4.01 -4.01 -4.00 -4.00 -4.00 -3.99 -3.99 -3.98 -3.98 -3.98 -3.98 -3.97 -3.97 -3.97 -3.97 -3.96 -3.95 -3.95 -3.94 -3.94 -3.94 -3.94 -3.93 -3.93 -3.93 -3.93 -3.93 -3.93 -3.92 -3.92 -3.92 -3.92 -3.92 -3.91 -3.91
1111

12+
# WER numbers
13+
14+
# without RNNLM
15+
# %WER 7.51 [ 618 / 8234, 82 ins, 112 del, 424 sub ] exp/chain/tdnn_lstm1b_sp/decode_looped_tgpr_dev93/wer_10_1.0
16+
# %WER 5.21 [ 294 / 5643, 55 ins, 34 del, 205 sub ] exp/chain/tdnn_lstm1b_sp/decode_looped_tgpr_eval92/wer_11_0.5
17+
18+
# with RNNLM
19+
# %WER 5.74 [ 473 / 8234, 81 ins, 76 del, 316 sub ] exp/chain/tdnn_lstm1b_sp/decode_looped_tgpr_dev93_rnnlm/wer_14_1.0
20+
# %WER 4.27 [ 241 / 5643, 62 ins, 23 del, 156 sub ] exp/chain/tdnn_lstm1b_sp/decode_looped_tgpr_eval92_rnnlm/wer_12_1.0
21+
1222
# Begin configuration section.
23+
1324
dir=exp/rnnlm_lstm_tdnn_1b
1425
embedding_dim=800
1526
lstm_rpd=200
@@ -21,6 +32,11 @@ epochs=20
2132
stage=-10
2233
train_stage=-10
2334

35+
# variables for rnnlm rescoring
36+
ac_model_dir=exp/chain/tdnn_lstm1b_sp
37+
ngram_order=4
38+
decode_dir_suffix=rnnlm
39+
2440
. ./cmd.sh
2541
. ./utils/parse_options.sh
2642
[ -z "$cmd" ] && cmd=$train_cmd
@@ -102,4 +118,20 @@ if [ $stage -le 3 ]; then
102118
--stage $train_stage --num-epochs $epochs --cmd "$cmd" $dir
103119
fi
104120

121+
LM=tgpr
122+
if [ $stage -le 4 ]; then
123+
for decode_set in dev93 eval92; do
124+
decode_dir=${ac_model_dir}/decode_looped_${LM}_${decode_set}
125+
126+
# Lattice rescoring
127+
rnnlm/lmrescore_pruned.sh \
128+
--cmd "$decode_cmd --mem 4G" \
129+
--weight 0.8 --max-ngram-order $ngram_order \
130+
data/lang_test_$LM $dir \
131+
data/test_${decode_set}_hires ${decode_dir} \
132+
${decode_dir}_${decode_dir_suffix} &
133+
done
134+
wait
135+
fi
136+
105137
exit 0

0 commit comments

Comments
 (0)