readme: ---
  language: pt
  datasets:
  - common_voice 
  - mls
  - cetuc
  - lapsbm
  - voxforge
  - tedx
  - sid
  metrics:
  - wer
  tags:
  - audio
  - speech
  - wav2vec2
  - pt
  - portuguese-speech-corpus
  - automatic-speech-recognition
  - speech
  - PyTorch
  - hf-asr-leaderboard
  model-index:
  - name: bp400-xlsr
    results:
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Common Voice 7.0
        type: mozilla-foundation/common_voice_7_0
        args: pt
      metrics:
      - name: Test WER
        type: wer
        value: 14.0
  license: apache-2.0
  ---
  
  # bp400-xlsr: Wav2vec 2.0 with Brazilian Portuguese (BP) Dataset
  
  **Paper:** https://arxiv.org/abs/2107.11414
  
  This is a the demonstration of a fine-tuned Wav2vec model for Brazilian Portuguese using the following datasets:
  
  - [CETUC](http://www02.smt.ufrj.br/~igor.quintanilha/alcaim.tar.gz): contains approximately 145 hours of Brazilian Portuguese speech distributed among 50 male and 50 female speakers, each pronouncing approximately 1,000 phonetically balanced sentences selected from the [CETEN-Folha](https://www.linguateca.pt/cetenfolha/) corpus.
  - [Common Voice 7.0](https://commonvoice.mozilla.org/pt):  is a project proposed by Mozilla Foundation with the goal to create a wide open dataset in different languages. In this project, volunteers donate and validate speech using the [oficial site](https://commonvoice.mozilla.org/pt). 
  - [Lapsbm](https://github.com/falabrasil/gitlab-resources): "Falabrasil - UFPA" is a dataset used by the Fala Brasil group to benchmark ASR systems in Brazilian Portuguese. Contains 35 speakers (10 females), each one pronouncing 20 unique sentences, totalling  700 utterances in Brazilian Portuguese. The audios were recorded in 22.05 kHz without environment control.
  - [Multilingual Librispeech (MLS)](https://arxiv.org/abs/2012.03411): a massive dataset available in many languages. The MLS is based on audiobook recordings in public domain like [LibriVox](https://librivox.org/). The dataset contains a total of 6k hours of transcribed data in many languages. The set in Portuguese [used in this work](http://www.openslr.org/94/) (mostly Brazilian variant) has approximately 284 hours of speech, obtained from 55 audiobooks read by 62 speakers.
  - [Multilingual TEDx](http://www.openslr.org/100): a collection of audio recordings from TEDx talks in 8 source languages. The Portuguese set (mostly Brazilian Portuguese variant) contains 164 hours of transcribed speech. 
  - [Sidney](https://igormq.github.io/datasets/) (SID): contains 5,777 utterances recorded by 72 speakers (20 women) from 17 to 59 years old with fields such as place of birth, age, gender, education, and occupation;
  - [VoxForge](http://www.voxforge.org/): is a project with the goal to build open datasets for acoustic models. The corpus contains approximately 100 speakers and 4,130 utterances of Brazilian Portuguese, with sample rates varying from 16kHz to 44.1kHz.
  
  These datasets were combined to build a larger Brazilian Portuguese dataset. All data was used for training except Common Voice dev/test sets, that were used for validation/test respectively. We also made test sets for all the gathered datasets.
  
  | Dataset                        |  Train | Valid |  Test |
  |--------------------------------|-------:|------:|------:|
  | CETUC                          |  93.9h |    -- |  5.4h |
  | Common Voice                   |  37.6h |  8.9h |  9.5h |
  | LaPS BM                        |   0.8h |    -- |  0.1h |
  | MLS                            | 161.0h |    -- |  3.7h |
  | Multilingual TEDx (Portuguese) | 144.2h |    -- |  1.8h |
  | SID                            |   5.0h |    -- |  1.0h |
  | VoxForge                       |   2.8h |    -- |  0.1h |
  | Total                          | 437.2h |  8.9h | 21.6h |
  
  The original model was fine-tuned using [fairseq](https://github.com/pytorch/fairseq). This notebook uses a converted version of the original one. The link to the original fairseq model is available [here](https://drive.google.com/drive/folders/1eRUExXRF2XK8JxUjIzbLBkLa5wuR3nig?usp=sharing).
  
  #### Summary
  
  |  | CETUC          | CV             | LaPS           | MLS            | SID            | TEDx           | VF             | AVG            |
  |----------------------|---------------|----------------|----------------|----------------|----------------|----------------|----------------|----------------|
  | bp\_400 (demonstration below)              |          0.052 |          0.140 |          0.074 |          0.117 |          0.121 |          0.245 |          0.118 |          0.124 |
  | bp\_400 + 3-gram      |  0.033 |  0.095 |  0.046 | 0.123 |          0.112 |          0.212 |          0.123 |          0.106 |
  | bp\_400 + 4-gram (demonstration below)  | **0.030** | 0.096 | 0.043 | **0.106** | 0.118 | 0.229 | **0.117** | **0.105** |
  | bp\_400 + 5-gram      | 0.033 |  0.094 |  0.043 | 0.123 | **0.111** | **0.210** | 0.123 | **0.105** |
  | bp\_400 + Transf.     | 0.032 | **0.092**