From 5a3a9e1f5055260f966d24680d5bb2e83f1d5b54 Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Tue, 22 Jun 2021 02:58:58 +0000 Subject: [PATCH 1/4] fix chunk default config; tarball ckpt prfix dir; --- examples/aishell/s1/README.md | 10 ++++++++++ examples/aishell/s1/conf/chunk_conformer.yaml | 2 +- utils/tarball.sh | 3 ++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/examples/aishell/s1/README.md b/examples/aishell/s1/README.md index 2048c4d5..c306f8aa 100644 --- a/examples/aishell/s1/README.md +++ b/examples/aishell/s1/README.md @@ -9,6 +9,16 @@ | conformer | conf/conformer.yaml | spec_aug + shift | test | ctc_prefix_beam_search | - | 0.062196 | | conformer | conf/conformer.yaml | spec_aug + shift | test | attention_rescoring | - | 0.054694 | +## Chunk Conformer + +| Model | Config | Augmentation| Test set | Decode method | Chunk | Loss | WER | +| --- | --- | --- | --- | --- | --- | --- | --- | +| conformer | conf/chunk_conformer.yaml | spec_aug + shift | test | attention | 16 | - | 0.061939 | +| conformer | conf/chunk_conformer.yaml | spec_aug + shift | test | ctc_greedy_search | 16 | - | 0.070806 | +| conformer | conf/chunk_conformer.yaml | spec_aug + shift | test | ctc_prefix_beam_search | 16 | - | 0.070739 | +| conformer | conf/chunk_conformer.yaml | spec_aug + shift | test | attention_rescoring | 16 | - | 0.059400 | + + ## Transformer | Model | Config | Augmentation| Test set | Decode method | Loss | WER | diff --git a/examples/aishell/s1/conf/chunk_conformer.yaml b/examples/aishell/s1/conf/chunk_conformer.yaml index 904624c3..e626e106 100644 --- a/examples/aishell/s1/conf/chunk_conformer.yaml +++ b/examples/aishell/s1/conf/chunk_conformer.yaml @@ -78,7 +78,7 @@ model: training: - n_epoch: 180 + n_epoch: 240 accum_grad: 4 global_grad_clip: 5.0 optim: adam diff --git a/utils/tarball.sh b/utils/tarball.sh index 100b4719..224b740c 100755 --- a/utils/tarball.sh +++ b/utils/tarball.sh @@ -18,7 +18,8 @@ function clean() { } trap clean EXIT -cp ${ckpt_prefix}.* ${output} +# ckpt_prfix.{json,...} and ckpt_prfix dir +cp -r ${ckpt_prefix}* ${output} cp ${model_config} ${mean_std} ${vocab} ${output} tar zcvf release.tar.gz ${output} From 68149cb9a7d39c14e95ada2979a4b7200eaf4902 Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Tue, 22 Jun 2021 03:25:26 +0000 Subject: [PATCH 2/4] fix config for new datapipeline --- examples/aishell/s1/README.md | 2 +- examples/aishell/s1/conf/chunk_conformer.yaml | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/examples/aishell/s1/README.md b/examples/aishell/s1/README.md index c306f8aa..601b0a8d 100644 --- a/examples/aishell/s1/README.md +++ b/examples/aishell/s1/README.md @@ -12,7 +12,7 @@ ## Chunk Conformer | Model | Config | Augmentation| Test set | Decode method | Chunk | Loss | WER | -| --- | --- | --- | --- | --- | --- | --- | --- | +| --- | --- | --- | --- | --- | --- | --- | --- | | conformer | conf/chunk_conformer.yaml | spec_aug + shift | test | attention | 16 | - | 0.061939 | | conformer | conf/chunk_conformer.yaml | spec_aug + shift | test | ctc_greedy_search | 16 | - | 0.070806 | | conformer | conf/chunk_conformer.yaml | spec_aug + shift | test | ctc_prefix_beam_search | 16 | - | 0.070739 | diff --git a/examples/aishell/s1/conf/chunk_conformer.yaml b/examples/aishell/s1/conf/chunk_conformer.yaml index e626e106..0e5b8699 100644 --- a/examples/aishell/s1/conf/chunk_conformer.yaml +++ b/examples/aishell/s1/conf/chunk_conformer.yaml @@ -3,17 +3,20 @@ data: train_manifest: data/manifest.train dev_manifest: data/manifest.dev test_manifest: data/manifest.test - vocab_filepath: data/vocab.txt - unit_type: 'char' - spm_model_prefix: '' - augmentation_config: conf/augmentation.json - batch_size: 32 min_input_len: 0.5 max_input_len: 20.0 # second min_output_len: 0.0 max_output_len: 400.0 min_output_input_ratio: 0.05 max_output_input_ratio: 10.0 + + +collator: + vocab_filepath: data/vocab.txt + unit_type: 'char' + spm_model_prefix: '' + augmentation_config: conf/augmentation.json + batch_size: 32 raw_wav: True # use raw_wav or kaldi feature specgram_type: fbank #linear, mfcc, fbank feat_dim: 80 @@ -30,7 +33,7 @@ data: keep_transcription_text: False sortagrad: True shuffle_method: batch_shuffle - num_workers: 0 + num_workers: 2 # network architecture From 1b84f21ccfda2794e323a69a163411ab15c17288 Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Tue, 22 Jun 2021 06:27:19 +0000 Subject: [PATCH 3/4] fix miss match --- utils/tarball.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/tarball.sh b/utils/tarball.sh index 224b740c..a4611c75 100755 --- a/utils/tarball.sh +++ b/utils/tarball.sh @@ -18,8 +18,11 @@ function clean() { } trap clean EXIT -# ckpt_prfix.{json,...} and ckpt_prfix dir -cp -r ${ckpt_prefix}* ${output} +# ckpt_prfix dir +cp -r ${ckpt_prefix} ${output} +# ckpt_prfix.{json,...} +cp ${ckpt_prefix}.* ${output} +# model config, mean std, vocab cp ${model_config} ${mean_std} ${vocab} ${output} tar zcvf release.tar.gz ${output} From 3c6eea077b2b077b9c3f5cc7baf339c545053d35 Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Tue, 22 Jun 2021 07:27:43 +0000 Subject: [PATCH 4/4] cp dir when it exits --- utils/tarball.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/tarball.sh b/utils/tarball.sh index a4611c75..5f7c21a3 100755 --- a/utils/tarball.sh +++ b/utils/tarball.sh @@ -19,7 +19,9 @@ function clean() { trap clean EXIT # ckpt_prfix dir -cp -r ${ckpt_prefix} ${output} +if [ -d ${ckpt_prefix} ];then + cp -r ${ckpt_prefix} ${output} +fi # ckpt_prfix.{json,...} cp ${ckpt_prefix}.* ${output} # model config, mean std, vocab