Skip to content

Commit

Permalink
Merge branch 'espnet:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
roshansh-cmu authored Apr 6, 2022
2 parents 39700a0 + c4aba12 commit fcf13c4
Show file tree
Hide file tree
Showing 60 changed files with 1,387 additions and 27 deletions.
2 changes: 2 additions & 0 deletions egs2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ See: https://espnet.github.io/espnet/espnet2_tutorial.html#recipes-using-espnet2
| mini_an4 | Mini version of CMU AN4 database for the integration test | ASR/TTS/SE | ENG | http://www.speech.cs.cmu.edu/databases/an4/ | |
| mini_librispeech | Mini version of Librispeech corpus | DIAR | ENG | https://openslr.org/31/ | |
| mls | MLS (A large multilingual corpus derived from LibriVox audiobooks) | ASR | 8 languages | http://www.openslr.org/94/ | |
| mr_openslr64 | OpenSLR Marathi Corpus | ASR | MAR | http://www.openslr.org/64/ | |
| ms_indic_is18 | Microsoft Speech Corpus (Indian languages) | ASR | 3 langs: TEL TAM GUJ | https://msropendata.com/datasets/7230b4b1-912d-400e-be58-f84e0512985e | |
| nsc | National Speech Corpus | ASR | ENG-SG | https://www.imda.gov.sg/programme-listing/digital-services-lab/national-speech-corpus | |
| open_li52 | Corpus combination with 52 languages(Commonvocie + voxforge) | Multilingual ASR | 52 languages | | |
Expand Down Expand Up @@ -97,3 +98,4 @@ See: https://espnet.github.io/espnet/espnet2_tutorial.html#recipes-using-espnet2
| yesno | The "yesno" corpus | ASR | HEB | http://www.openslr.org/1 | |
| yoloxochitl_mixtec | Yoloxochitl-Mixtec corpus (endangered language in central Mexico) | ASR | XTY | http://www.openslr.org/89 | |
| zeroth_korean | Zeroth-Korean | ASR | KOR | http://www.openslr.org/40 | |
| zh_openslr38 | ST-CMDS-20170001_1, Free ST Chinese Mandarin Corpus | ASR | CMN | http://www.openslr.org/38 | |
2 changes: 2 additions & 0 deletions egs2/TEMPLATE/asr1/db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ PRIMEWORDS_CHINESE=downloads
SEAME=
BENGALI=downloads
IWSLT14=
ST_CMDS=downloads
MS_INDIC_IS18=
MARATHI=downloads

# For only CMU TIR environment
if [[ "$(hostname)" == tir* ]]; then
Expand Down
36 changes: 36 additions & 0 deletions egs2/mr_openslr64/asr1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# RESULTS
## Environments
- date: `Mon Mar 21 16:06:03 UTC 2022`
- python version: `3.9.7 (default, Sep 16 2021, 13:09:58) [GCC 7.5.0]`
- espnet version: `espnet 0.10.7a1`
- pytorch version: `pytorch 1.11.0+cu102`
- Git hash: `91325a1e58ca0b13494b94bf79b186b095fe0b58`
- Commit date: `Mon Mar 21 00:40:52 2022 +0000`

## asr_train_asr_conformer_xlsr_raw_bpe150_sp

This recipe is for the Marathi language and is trained on the [OpenSLR Marathi](https://www.openslr.org/64/) multi-speaker speech data set.

The following results are obtained by using an XLSR frontend.

Train ASR Config: [conf/tuning/train_asr_conformer_xlsr.yaml](conf/tuning/train_asr_conformer_xlsr.yaml)

Trained Model: [espnet/marathi_openslr64](https://huggingface.co/espnet/marathi_openslr64)

### WER

|dataset|Snt|Wrd|Corr|Sub|Del|Ins|Err|S.Err|
|---|---|---|---|---|---|---|---|---|
|decode_asr_batch_size1_asr_model_valid.acc.ave/marathi_test|299|3625|72.9|22.5|4.7|1.7|28.9|88.6|

### CER

|dataset|Snt|Wrd|Corr|Sub|Del|Ins|Err|S.Err|
|---|---|---|---|---|---|---|---|---|
|decode_asr_batch_size1_asr_model_valid.acc.ave/marathi_test|299|20557|91.4|3.1|5.5|1.9|10.5|88.6|

### TER

|dataset|Snt|Wrd|Corr|Sub|Del|Ins|Err|S.Err|
|---|---|---|---|---|---|---|---|---|
|decode_asr_batch_size1_asr_model_valid.acc.ave/marathi_test|299|13562|86.5|6.3|7.1|1.4|14.9|88.6|
1 change: 1 addition & 0 deletions egs2/mr_openslr64/asr1/asr.sh
1 change: 1 addition & 0 deletions egs2/mr_openslr64/asr1/cmd.sh
1 change: 1 addition & 0 deletions egs2/mr_openslr64/asr1/conf/decode_asr.yaml
2 changes: 2 additions & 0 deletions egs2/mr_openslr64/asr1/conf/fbank.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sample-frequency=16000
--num-mel-bins=80
11 changes: 11 additions & 0 deletions egs2/mr_openslr64/asr1/conf/pbs.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Default configuration
command qsub -V -v PATH -S /bin/bash
option name=* -N $0
option mem=* -l mem=$0
option mem=0 # Do not add anything to qsub_opts
option num_threads=* -l ncpus=$0
option num_threads=1 # Do not add anything to qsub_opts
option num_nodes=* -l nodes=$0:ppn=1
default gpu=0
option gpu=0
option gpu=* -l ngpus=$0
1 change: 1 addition & 0 deletions egs2/mr_openslr64/asr1/conf/pitch.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--sample-frequency=16000
12 changes: 12 additions & 0 deletions egs2/mr_openslr64/asr1/conf/queue.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Default configuration
command qsub -v PATH -cwd -S /bin/bash -j y -l arch=*64*
option name=* -N $0
option mem=* -l mem_free=$0,ram_free=$0
option mem=0 # Do not add anything to qsub_opts
option num_threads=* -pe smp $0
option num_threads=1 # Do not add anything to qsub_opts
option max_jobs_run=* -tc $0
option num_nodes=* -pe mpi $0 # You must set this PE as allocation_rule=1
default gpu=0
option gpu=0
option gpu=* -l gpu=$0 -q g.q
14 changes: 14 additions & 0 deletions egs2/mr_openslr64/asr1/conf/slurm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Default configuration
command sbatch --export=PATH
option name=* --job-name $0
option time=* --time $0
option mem=* --mem-per-cpu $0
option mem=0
option num_threads=* --cpus-per-task $0
option num_threads=1 --cpus-per-task 1
option num_nodes=* --nodes $0
default gpu=0
option gpu=0 -p cpu
option gpu=* -p gpu --gres=gpu:$0 -c $0 # Recommend allocating more CPU than, or equal to the number of GPU
# note: the --max-jobs-run option is supported as a special case
# by slurm.pl and you don't have to handle it in the config file.
1 change: 1 addition & 0 deletions egs2/mr_openslr64/asr1/conf/train_asr.yaml
14 changes: 14 additions & 0 deletions egs2/mr_openslr64/asr1/conf/train_lm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
lm_conf:
nlayers: 2
unit: 650
optim: sgd # or adam
batch_type: folded
batch_size: 64 # batch size in LM training
max_epoch: 20 # if the data size is large, we can reduce this
patience: 3

best_model_criterion:
- - valid
- loss
- min
keep_nbest_models: 1
6 changes: 6 additions & 0 deletions egs2/mr_openslr64/asr1/conf/tuning/decode_rnn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lm_weight: 0.3
beam_size: 20
penalty: 0.0
maxlenratio: 0.0
minlenratio: 0.0
ctc_weight: 0.6
7 changes: 7 additions & 0 deletions egs2/mr_openslr64/asr1/conf/tuning/decode_transformer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
batch_size: 16
beam_size: 20
penalty: 0.0
maxlenratio: 0.0
minlenratio: 0.0
ctc_weight: 0.5
lm_weight: 0.3
67 changes: 67 additions & 0 deletions egs2/mr_openslr64/asr1/conf/tuning/train_asr_conformer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
batch_type: numel
batch_bins: 10000
accum_grad: 3
max_epoch: 60
patience: none
init: xavier_uniform
best_model_criterion:
- - valid
- acc
- max
keep_nbest_models: 5

encoder: conformer
encoder_conf:
output_size: 512
attention_heads: 4
linear_units: 1024
num_blocks: 3
dropout_rate: 0.3
positional_dropout_rate: 0.3
attention_dropout_rate: 0.3
input_layer: conv2d
normalize_before: true
macaron_style: false
pos_enc_layer_type: "rel_pos"
selfattention_layer_type: "rel_selfattn"
activation_type: "swish"
use_cnn_module: true
cnn_module_kernel: 17

decoder: transformer
decoder_conf:
attention_heads: 4
linear_units: 1024
num_blocks: 3
dropout_rate: 0.3
positional_dropout_rate: 0.3
self_attention_dropout_rate: 0.3
src_attention_dropout_rate: 0.3

model_conf:
ctc_weight: 0.3
lsm_weight: 0.1
length_normalized_loss: false

optim: adam
optim_conf:
lr: 0.0005
scheduler: warmuplr
scheduler_conf:
warmup_steps: 20000

specaug: specaug
specaug_conf:
apply_time_warp: true
time_warp_window: 5
time_warp_mode: bicubic
apply_freq_mask: true
freq_mask_width_range:
- 0
- 30
num_freq_mask: 2
apply_time_mask: true
time_mask_width_range:
- 0
- 40
num_time_mask: 2
88 changes: 88 additions & 0 deletions egs2/mr_openslr64/asr1/conf/tuning/train_asr_conformer_xlsr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
batch_type: numel
batch_bins: 10000
accum_grad: 3
max_epoch: 60
patience: none
init: xavier_uniform
best_model_criterion:
- - valid
- acc
- max
keep_nbest_models: 5

freeze_param: [
"frontend.upstream"
]

frontend_conf:
n_fft: 512
hop_length: 256

frontend: s3prl
frontend_conf:
frontend_conf:
upstream: wav2vec2_xlsr # Note: If the upstream is changed, please change the input_size in the preencoder.
download_dir: ./hub
multilayer_feature: True

preencoder: linear
preencoder_conf:
input_size: 1024 # Note: If the upstream is changed, please change this value accordingly.
output_size: 80

encoder: conformer
encoder_conf:
output_size: 512
attention_heads: 4
linear_units: 1024
num_blocks: 3
dropout_rate: 0.3
positional_dropout_rate: 0.3
attention_dropout_rate: 0.3
input_layer: conv2d
normalize_before: true
macaron_style: false
pos_enc_layer_type: "rel_pos"
selfattention_layer_type: "rel_selfattn"
activation_type: "swish"
use_cnn_module: true
cnn_module_kernel: 17

decoder: transformer
decoder_conf:
attention_heads: 4
linear_units: 1024
num_blocks: 3
dropout_rate: 0.3
positional_dropout_rate: 0.3
self_attention_dropout_rate: 0.3
src_attention_dropout_rate: 0.3

model_conf:
ctc_weight: 0.3
lsm_weight: 0.1
length_normalized_loss: false
extract_feats_in_collect_stats: false # Note: "False" means during collect stats (stage 10), generating dummy stats files rather than extract_feats by forward frontend.

optim: adam
optim_conf:
lr: 0.0005
scheduler: warmuplr
scheduler_conf:
warmup_steps: 20000

specaug: specaug
specaug_conf:
apply_time_warp: true
time_warp_window: 5
time_warp_mode: bicubic
apply_freq_mask: true
freq_mask_width_range:
- 0
- 30
num_freq_mask: 2
apply_time_mask: true
time_mask_width_range:
- 0
- 40
num_time_mask: 2
35 changes: 35 additions & 0 deletions egs2/mr_openslr64/asr1/conf/tuning/train_asr_rnn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# network architecture
# encoder related
encoder: vgg_rnn
encoder_conf:
rnn_type: lstm # encoder architecture type
bidirectional: True
use_projection: True
num_layers: 4
hidden_size: 1024
output_size: 1024

# decoder related
decoder: rnn
decoder_conf:
num_layers: 2
hidden_size: 1024
sampling_probability: 0
att_conf:
atype: location
adim: 1024
aconv_chans: 10
aconv_filts: 100

# hybrid CTC/attention
model_conf:
ctc_weight: 0.5

# minibatch related
batch_size: 30

# optimization related
optim: adadelta
max_epoch: 15
patience: 3

Loading

0 comments on commit fcf13c4

Please sign in to comment.