refactor the code

pull/931/head
huangyuxin 4 years ago
parent c2e3e1f0ca
commit ae9f379547

@ -85,8 +85,8 @@ def recog_v2(args):
if args.preprocess_conf is None else args.preprocess_conf, if args.preprocess_conf is None else args.preprocess_conf,
preprocess_args={"train": False}, ) preprocess_args={"train": False}, )
if args.rnnlm: if args.use_lm:
lm_path = args.rnnlm lm_path = args.rnnlm_path
lm_config_path = args.rnnlm_conf lm_config_path = args.rnnlm_conf
lm_config = get_config(lm_config_path) lm_config = get_config(lm_config_path)
lm_class = dynamic_import_lm("transformer") lm_class = dynamic_import_lm("transformer")

@ -11,8 +11,9 @@ tag=
decode_config=conf/decode/decode.yaml decode_config=conf/decode/decode.yaml
# lm params # lm params
use_lm=true
lang_model=transformerLM.pdparams lang_model=transformerLM.pdparams
lmexpdir=exp/transformerLM lmexpdir=exp/lm/transformer
lmtag='nolm' lmtag='nolm'
rnnlm_config_path=conf/lm/transformer.yaml rnnlm_config_path=conf/lm/transformer.yaml
@ -94,8 +95,9 @@ for dmethd in join_ctc; do
--result-label ${decode_dir}/data.JOB.json \ --result-label ${decode_dir}/data.JOB.json \
--model-conf ${config_path} \ --model-conf ${config_path} \
--model ${ckpt_prefix}.pdparams \ --model ${ckpt_prefix}.pdparams \
--use_rnnlm ${use_lm} \
--rnnlm-conf ${rnnlm_config_path} \ --rnnlm-conf ${rnnlm_config_path} \
--rnnlm ${lmexpdir}/${lang_model} --rnnlm-path ${lmexpdir}/${lang_model}
score_sclite.sh --bpe ${nbpe} --bpemodel ${bpemodel} --wer false ${decode_dir} ${dict} score_sclite.sh --bpe ${nbpe} --bpemodel ${bpemodel} --wer false ${decode_dir} ${dict}

Loading…
Cancel
Save