Skip to content

Commit

Permalink
further fixing swbd recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
sw005320 committed Aug 9, 2019
1 parent 28f0699 commit 621accc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions egs/swbd/asr1/conf/tuning/decode_pytorch_transformer.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
batchsize: 0
lm-weight: 1.0
beam-size: 20
penalty: 0.1
Expand Down
2 changes: 1 addition & 1 deletion egs/swbd/asr1/conf/tuning/train_pytorch_transformer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ opt: noam
accum-grad: 2
grad-clip: 5
patience: 0
epochs: 30
epochs: 100
dropout-rate: 0.1

# transformer specific setting
Expand Down
20 changes: 15 additions & 5 deletions egs/swbd/asr1/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ decode_config=conf/decode.yaml

# decoding parameter
recog_model=model.acc.best # set a model to be used for decoding: 'model.acc.best' or 'model.loss.best'
n_average=10

# data
swbd1_dir=/export/corpora3/LDC/LDC97S62
eval2000_dir="/export/corpora2/LDC/LDC2002S09/hub5e_00 /export/corpora2/LDC/LDC2002T43"
rt03_dir=/export/corpora/LDC/LDC2007S10

# bpemode (unigram or bpe)
nbpe=500
nbpe=2000
bpemode=bpe

# exp tag
Expand Down Expand Up @@ -206,7 +207,13 @@ fi
if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then
echo "stage 4: Decoding"
nj=32

if [[ $(get_yaml.py ${train_config} model-module) = *transformer* ]]; then
recog_model=model.last${n_average}.avg.best
average_checkpoints.py --backend ${backend} \
--snapshots ${expdir}/results/snapshot.ep.* \
--out ${expdir}/results/${recog_model} \
--num ${n_average}
fi
pids=() # initialize pids
for rtask in ${recog_set}; do
(
Expand All @@ -228,10 +235,13 @@ if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then
--result-label ${expdir}/${decode_dir}/data.JOB.json \
--model ${expdir}/results/${recog_model}

# this is required for local/score_sclite.sh to get hyp.wrd.trn
score_sclite.sh --bpe ${nbpe} --bpemodel ${bpemodel}.model --wer true ${expdir}/${decode_dir} ${dict}
local/score_sclite.sh data/eval2000 ${expdir}/${decode_dir}
local/score_sclite.sh data/rt03 ${expdir}/${decode_dir}

if [ "`echo ${decode_dir} | grep eval2000`" ]; then
local/score_sclite.sh data/eval2000 ${expdir}/${decode_dir}
elif [ "`echo ${decode_dir} | grep rt03`" ]; then
local/score_sclite.sh data/rt03 ${expdir}/${decode_dir}
fi
) &
pids+=($!) # store background pids
done
Expand Down
Empty file modified utils/trn2ctm.py
100644 → 100755
Empty file.

0 comments on commit 621accc

Please sign in to comment.