Blame view

egs/csj/s5/local/csj_run_rnnlm.sh 2.49 KB
8dcb6dfcb   Yannick Estève   first commit
1
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
  #!/bin/bash
  
  # Copyright  2016 Tokyo Institute of Technology (Authors: Tomohiro Tanaka, Takafumi Moriya and Takahiro Shinozaki)
  #            2016 Mitsubishi Electric Research Laboratories (Author: Shinji Watanabe)
  # Apache 2.0
  # Acknowledgement  This work was supported by JSPS KAKENHI Grant Number 26280055.
  
  [ -f ./path.sh ] && . ./path.sh
  . utils/parse_options.sh
  . ./cmd.sh
  
  if [ -e data/train_dev ] ;then
      dev_set=train_dev
  fi
  
  rnnlm_ver=rnnlm-0.3e
  
  #:<<"#SKIP"
  
  echo h30 Begin
  local/csj_train_rnnlms.sh --dict-suffix "_nosp" data/local/rnnlm.h30
  sleep 20; # wait till tools compiled.
  
  echo h100 Begin
  local/csj_train_rnnlms.sh --dict-suffix "_nosp" \
      --hidden 100 --nwords 10000 --class 200 \
      --direct 0 data/local/rnnlm.h100
  
  echo h200 Begin
  local/csj_train_rnnlms.sh --dict-suffix "_nosp" \
      --hidden 200 --nwords 10000 --class 200 \
      --direct 0 data/local/rnnlm.h200
  
  echo h300 Begin
  local/csj_train_rnnlms.sh --dict-suffix "_nosp" \
      --hidden 300 --nwords 10000 --class 200 \
      --direct 0 data/local/rnnlm.h300
  
  echo h400 Begin
  local/csj_train_rnnlms.sh --dict-suffix "_nosp" \
      --hidden 400 --nwords 10000 --class 200 \
      --direct 0 data/local/rnnlm.h400
  
  echo h500 Begin
  local/csj_train_rnnlms.sh --dict-suffix "_nosp" \
      --hidden 500 --nwords 10000 --class 200 \
      --direct 0 data/local/rnnlm.h500
  
  #SKIP
  
  echo Begin rescoring
  sourceresult=dnn5b_pretrain-dbn_dnn_smbr_i1lats
  acwt=17
  
  for dict in rnnlm.h30 rnnlm.h100 rnnlm.h200 rnnlm.h300 rnnlm.h400 rnnlm.h500 ;do
    for eval_num in eval1 eval2 eval3 $dev_set ;do
        dir=data/local/$dict
        sourcedir=exp/${sourceresult}/decode_${eval_num}_csj
        resultsdir=${sourcedir}_${dict}
  
        echo "rnnlm0.5"
        steps/rnnlmrescore.sh --rnnlm_ver $rnnlm_ver \
          --N 100 --cmd "$decode_cmd --mem 1G" --inv-acwt $acwt 0.5 \
          data/lang_csj_tg $dir data/$eval_num $sourcedir ${resultsdir}_L0.5
  
        rm -rf ${resultsdir}_L0.25
        rm -rf ${resultsdir}_L0.75
        cp -rp ${resultsdir}_L0.5 ${resultsdir}_L0.25
        cp -rp ${resultsdir}_L0.5 ${resultsdir}_L0.75
  
        echo "rnnlm0.25"
        steps/rnnlmrescore.sh --rnnlm_ver $rnnlm_ver \
          --stage 7 --N 100 --cmd "$decode_cmd --mem 1G" --inv-acwt $acwt 0.25 \
          data/lang_csj_tg $dir data/$eval_num $sourcedir ${resultsdir}_L0.25
  
        echo "rnnlm0.75"
        steps/rnnlmrescore.sh --rnnlm_ver $rnnlm_ver \
          --stage 7 --N 100 --cmd "$decode_cmd --mem 1G" --inv-acwt $acwt 0.75 \
          data/lang_csj_tg $dir data/$eval_num $sourcedir ${resultsdir}_L0.75
    done
  done