readme: ---
  license: apache-2.0
  language: fi
  metrics:
  - wer
  - cer
  tags:
  - automatic-speech-recognition
  - fi
  - finnish
  - generated_from_trainer
  - hf-asr-leaderboard
  - robust-speech-event
  datasets:
  - mozilla-foundation/common_voice_7_0
  model-index:
  - name: wav2vec2-xlsr-1b-finnish-v2
    results:
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Common Voice 7
        type: mozilla-foundation/common_voice_7_0
        args: fi
      metrics:
      - name: Test WER
        type: wer
        value: 9.73
      - name: Test CER
        type: cer
        value: 1.65
  ---
  
  # Wav2Vec2 XLS-R for Finnish ASR
  
  This acoustic model is a fine-tuned version of [facebook/wav2vec2-xls-r-1b](https://huggingface.co/facebook/wav2vec2-xls-r-1b) for Finnish ASR. The model has been fine-tuned with 275.6 hours of Finnish transcribed speech data. Wav2Vec2 XLS-R was introduced in
  [this paper](https://arxiv.org/abs/2111.09296) and first released at [this page](https://github.com/pytorch/fairseq/tree/main/examples/wav2vec#wav2vec-20).
  
  **Note**: there is a version with KenLM language model used in the decoding phase producing better transcriptions: [Finnish-NLP/wav2vec2-xlsr-1b-finnish-lm-v2](https://huggingface.co/Finnish-NLP/wav2vec2-xlsr-1b-finnish-lm-v2)
  
  ## Model description
  
  Wav2Vec2 XLS-R is Facebook AI's large-scale multilingual pretrained model for speech. It is pretrained on 436k hours of unlabeled speech, including VoxPopuli, MLS, CommonVoice, BABEL, and VoxLingua107. It uses the wav2vec 2.0 objective, in 128 languages.
  
  You can read more about the pretrained model from [this blog](https://ai.facebook.com/blog/xls-r-self-supervised-speech-processing-for-128-languages) and [this paper](https://arxiv.org/abs/2111.09296).
  
  This model is fine-tuned version of the pretrained model (1 billion parameter variant) for Finnish ASR.
  
  ## Intended uses & limitations
  
  You can use this model for Finnish ASR (speech-to-text) task. 
  
  ### How to use
  
  Check the [run-finnish-asr-models.ipynb](https://huggingface.co/aapot/wav2vec2-xlsr-1b-finnish-v2/blob/main/run-finnish-asr-models.ipynb) notebook in this repository for an detailed example on how to use this model.
  
  ### Limitations and bias
  
  This model was fine-tuned with audio samples which maximum length was 20 seconds so this model most likely works the best for quite short audios of similar length. However, you can try this model with a lot longer audios too and see how it works. If you encounter out of memory errors with very long audio files you can use the audio chunking method introduced in [this blog post](https://huggingface.co/blog/asr-chunking).
  
  A vast majority of the data used for fine-tuning was from the Finnish Parliament dataset so this model may not generalize so well to very different domains like common daily spoken Finnish with dialects etc. In addition, audios of the datasets tend to be adult male dominated so this model may not work as well for speeches of children and women, for example.
  
  ## Training data
  
  This model was fine-tuned with 275.6 hours of Finnish transcribed speech data from following datasets:
  
  | Dataset                                                                                                                           | Hours    | % of total hours |
  |:------------------------------------------------------------------------------------------------------------------------------    |:--------:|:----------------:|
  | [Common Voice 7.0 Finnish train + evaluation + other splits](https://huggingface.co/datasets/mozilla-foundation/common_voice_7_0) | 9.70 h   | 3.52 %           |
  | [Finnish parliament session 2](https://b2share.eudat.eu/records/4df422d631544ce682d6af1d4714b2d4)                                 | 0.24 h   | 0.09 %           |
  | [VoxPopuli Finnish](https://github.com/facebookresearch/voxpopuli)                                                                | 21.97 h  | 7.97 %           |
  | [CSS10 Finnish](https://github.com/kyubyong/css10)                                                                                | 10.32 h  | 3.74 %           |
  | [Aalto Finnish Parliament ASR Corpus](http://urn.fi/urn:nbn:fi:lb-2021051903)                                                     | 228.00 h | 82.73 %          |
  | [Finnish Broadcast Corpus](http://urn.fi/urn:nbn:fi:lb-2016042502)                                                                | 5.37 h   | 1.95 %           |
  
  Datasets were filtered to include maximum length of 20 seconds long audio samples.
  
  ## Training procedure
  
  This model was trained during [Robust Speech Challenge Event](https://discuss.huggingface.co/t/open-to-the-community-robust-speech-recognition-challenge/13614) organized by Hugging Face. Training was done on a Tesla V100 GPU, sponsored by OVHcloud.
  
  Training script was provided by Hugging Face and it is available [here](https://github.com/huggingface/transformers/blob/main/examples/research_projects/robust-speech-event/run_speech_recogniti