# ############################################################################ # Model: E2E ASR with Transformer # Encoder: Transformer Encoder # Decoder: Transformer Decoder + (CTC/ATT joint) beamsearch + TransformerLM # Tokens: unigram # losses: CTC + KLdiv (Label Smoothing loss) # Training: Librispeech 960h # Authors: Jianyuan Zhong, Titouan Parcollet 2021 # ############################################################################ # Feature parameters sample_rate: 16000 n_fft: 400 n_mels: 80 ####################### Model parameters ########################### # Transformer d_model: 768 nhead: 8 num_encoder_layers: 12 num_decoder_layers: 6 d_ffn: 3072 transformer_dropout: 0.0 activation: !name:torch.nn.GELU output_neurons: 5000 vocab_size: 5000 # Outputs blank_index: 0 label_smoothing: 0.1 pad_index: 0 bos_index: 1 eos_index: 2 unk_index: 0 # Decoding parameters min_decode_ratio: 0.0 max_decode_ratio: 1.0 valid_search_interval: 10 valid_beam_size: 10 test_beam_size: 66 lm_weight: 0.60 ctc_weight_decode: 0.52 ############################## models ################################ CNN: !new:speechbrain.lobes.models.convolution.ConvolutionFrontEnd input_shape: (8, 10, 80) num_blocks: 3 num_layers_per_block: 1 out_channels: (128, 256, 512) kernel_sizes: (3, 3, 1) strides: (2, 2, 1) residuals: (False, False, False) Transformer: !new:speechbrain.lobes.models.transformer.TransformerASR.TransformerASR input_size: 10240 tgt_vocab: !ref d_model: !ref nhead: !ref num_encoder_layers: !ref num_decoder_layers: !ref d_ffn: !ref dropout: !ref activation: !ref normalize_before: False ctc_lin: !new:speechbrain.nnet.linear.Linear input_size: !ref n_neurons: !ref seq_lin: !new:speechbrain.nnet.linear.Linear input_size: !ref n_neurons: !ref beam_searcher: !new:speechbrain.decoders.S2STransformerBeamSearch modules: [!ref , !ref , !ref ] bos_index: !ref eos_index: !ref blank_index: !ref min_decode_ratio: !ref max_decode_ratio: !ref beam_size: !ref ctc_weight: !ref lm_weight: !ref lm_modules: !ref temperature: 1.15 temperature_lm: 1.15 using_eos_threshold: False length_normalization: True log_softmax: !new:torch.nn.LogSoftmax dim: -1 normalize: !new:speechbrain.processing.features.InputNormalization norm_type: global update_until_epoch: 4 compute_features: !new:speechbrain.lobes.features.Fbank sample_rate: !ref n_fft: !ref n_mels: !ref # This is the Transformer LM that is used according to the Huggingface repository # Visit the HuggingFace model corresponding to the pretrained_lm_tokenizer_path # For more details about the model! # NB: It has to match the pre-trained TransformerLM!! lm_model: !new:speechbrain.lobes.models.transformer.TransformerLM.TransformerLM vocab: 5000 d_model: 768 nhead: 12 num_encoder_layers: 12 num_decoder_layers: 0 d_ffn: 3072 dropout: 0.0 activation: !name:torch.nn.GELU normalize_before: False tokenizer: !new:sentencepiece.SentencePieceProcessor asr_encoder: !new:speechbrain.utils.callchains.LengthsCapableChain - !ref - !ref # Models asr_model: !new:torch.nn.ModuleList - [!ref , !ref , !ref , !ref ] modules: compute_features: !ref pre_transformer: !ref transformer: !ref asr_model: !ref normalize: !ref lm_model: !ref beam_searcher: !ref # The pretrainer allows a mapping between pretrained files and instances that # are declared in the yaml. pretrainer: !new:speechbrain.utils.parameter_transfer.Pretrainer loadables: asr: !ref lm: !ref tokenizer: !ref