Automatic Speech Recognition
speechbrain
PyTorch
English
CTC
Attention
Transformer
Conformer
hf-asr-leaderboard
Eval Results
Instructions to use speechbrain/asr-conformer-loquacious with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- speechbrain
How to use speechbrain/asr-conformer-loquacious with speechbrain:
from speechbrain.pretrained import EncoderDecoderASR model = EncoderDecoderASR.from_hparams( "speechbrain/asr-conformer-loquacious" ) model.transcribe_file("file.wav") - Notebooks
- Google Colab
- Kaggle
| # ############################################################################ | |
| # Model: E2E ASR with Transformer | |
| # Encoder: Conformer Encoder | |
| # Decoder: Transformer Decoder + (CTC/att joint) | |
| # Tokens: bpe | |
| # losses: CTC + KLdiv (Label Smoothing loss) | |
| # Authors: Titouan Parcollet | |
| # ############################################################################ | |
| # Feature parameters | |
| sample_rate: 16000 | |
| n_fft: 400 | |
| n_mels: 80 | |
| ####################### Model Parameters ########################### | |
| # Transformer | |
| d_model: 1024 | |
| nhead: 16 | |
| num_encoder_layers: 18 | |
| num_decoder_layers: 6 | |
| d_ffn: 3072 | |
| transformer_dropout: 0.1 | |
| activation: !name:torch.nn.GELU | |
| output_neurons: 5120 | |
| # Outputs | |
| blank_index: 3 | |
| label_smoothing: 0.1 | |
| pad_index: 0 | |
| bos_index: 1 | |
| eos_index: 2 | |
| # Decoding parameters | |
| min_decode_ratio: 0.0 | |
| max_decode_ratio: 1.0 | |
| test_beam_size: 10 | |
| ctc_weight_decode: 0.3 | |
| scorer_beam_scale: 0.3 | |
| transformer_beam_search: True | |
| ############################## models ################################ | |
| tokenizer: !new:sentencepiece.SentencePieceProcessor | |
| normalizer: !new:speechbrain.processing.features.InputNormalization | |
| norm_type: global | |
| compute_features: !new:speechbrain.lobes.features.Fbank | |
| sample_rate: !ref <sample_rate> | |
| n_fft: !ref <n_fft> | |
| n_mels: !ref <n_mels> | |
| CNN: !new:speechbrain.lobes.models.convolution.ConvolutionFrontEnd | |
| input_shape: (8, 10, 80) | |
| num_blocks: 2 | |
| num_layers_per_block: 1 | |
| out_channels: (64, 32) | |
| kernel_sizes: (3, 3) | |
| strides: (2, 2) | |
| residuals: (False, False) | |
| Transformer: !new:speechbrain.lobes.models.transformer.TransformerASR.TransformerASR # yamllint disable-line rule:line-length | |
| input_size: 640 | |
| tgt_vocab: !ref <output_neurons> | |
| d_model: !ref <d_model> | |
| nhead: !ref <nhead> | |
| num_encoder_layers: !ref <num_encoder_layers> | |
| num_decoder_layers: !ref <num_decoder_layers> | |
| d_ffn: !ref <d_ffn> | |
| dropout: !ref <transformer_dropout> | |
| conformer_activation: !ref <activation> | |
| activation: !ref <activation> | |
| encoder_module: conformer | |
| attention_type: RelPosMHAXL | |
| normalize_before: True | |
| causal: False | |
| ctc_lin: !new:speechbrain.nnet.linear.Linear | |
| input_size: !ref <d_model> | |
| n_neurons: !ref <output_neurons> | |
| seq_lin: !new:speechbrain.nnet.linear.Linear | |
| input_size: !ref <d_model> | |
| n_neurons: !ref <output_neurons> | |
| asr_model: !new:torch.nn.ModuleList | |
| - [!ref <CNN>, !ref <Transformer>, !ref <seq_lin>, !ref <ctc_lin>] | |
| # Scorer | |
| ctc_scorer: !new:speechbrain.decoders.scorer.CTCScorer | |
| eos_index: !ref <eos_index> | |
| blank_index: !ref <blank_index> | |
| ctc_fc: !ref <ctc_lin> | |
| scorer: !new:speechbrain.decoders.scorer.ScorerBuilder | |
| full_scorers: [!ref <ctc_scorer>] | |
| weights: | |
| ctc: !ref <ctc_weight_decode> | |
| scorer_beam_scale: !ref <scorer_beam_scale> | |
| # We compose the inference (encoder) pipeline. | |
| encoder: !new:speechbrain.nnet.containers.LengthsCapableSequential | |
| input_shape: [null, null, !ref <n_mels>] | |
| compute_features: !ref <compute_features> | |
| normalize: !ref <normalizer> | |
| CNN: !ref <CNN> | |
| decoder: !new:speechbrain.decoders.S2STransformerBeamSearcher | |
| modules: [!ref <Transformer>, !ref <seq_lin>] | |
| bos_index: !ref <bos_index> | |
| eos_index: !ref <eos_index> | |
| min_decode_ratio: !ref <min_decode_ratio> | |
| max_decode_ratio: !ref <max_decode_ratio> | |
| beam_size: !ref <test_beam_size> | |
| temperature: 1.15 | |
| using_eos_threshold: True | |
| scorer: !ref <scorer> | |
| modules: | |
| normalizer: !ref <normalizer> | |
| encoder: !ref <encoder> | |
| transformer: !ref <Transformer> | |
| decoder: !ref <decoder> | |
| ctc_lin: !ref <ctc_lin> | |
| log_softmax: !new:torch.nn.LogSoftmax | |
| dim: -1 | |
| pretrainer: !new:speechbrain.utils.parameter_transfer.Pretrainer | |
| loadables: | |
| normalizer: !ref <normalizer> | |
| asr: !ref <asr_model> | |
| tokenizer: !ref <tokenizer> |