readme: ---
  language: is
  datasets:
  - samromur
  - samromur_children
  - malromur
  - althingi
  tags:
  - audio
  - automatic-speech-recognition
  - icelandic
  - xlrs-53-icelandic
  - iceland
  - reykjavik
  - samromur
  license: cc-by-4.0
  widget:
  model-index:
  - name: wav2vec2-large-xlsr-53-icelandic-ep10-1000h
    results:
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Samrómur (Test)
        type: language-and-voice-lab/samromur_asr
        split: test
        args: 
          language: is
      metrics:
      - name: WER
        type: wer
        value: 9.847
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Samrómur (Dev)
        type: language-and-voice-lab/samromur_asr
        split: validation
        args: 
          language: is
      metrics:
      - name: WER
        type: wer
        value: 8.736
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Samrómur Children (Test)
        type: language-and-voice-lab/samromur_children
        split: test
        args: 
          language: is
      metrics:
      - name: WER
        type: wer
        value: 9.391
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Samrómur Children (Dev)
        type: language-and-voice-lab/samromur_children
        split: validation
        args: 
          language: is
      metrics:
      - name: WER
        type: wer
        value: 6.055
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Malrómur (Test)
        type: language-and-voice-lab/malromur_asr
        split: test
        args: 
          language: is
      metrics:
      - name: WER
        type: wer
        value: 5.643
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Malrómur (Dev)
        type: language-and-voice-lab/malromur_asr
        split: validation
        args: 
          language: is
      metrics:
      - name: WER
        type: wer
        value: 6.156
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Althingi (Test)
        type: language-and-voice-lab/althingi_asr
        split: test
        args: 
          language: is
      metrics:
      - name: WER
        type: wer
        value: 11.437
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Althingi (Dev)
        type: language-and-voice-lab/althingi_asr
        split: validation
        args: 
          language: is
      metrics:
      - name: WER
        type: wer
        value: 11.093
  ---
  # wav2vec2-large-xlsr-53-icelandic-ep10-1000h
  
  The "wav2vec2-large-xlsr-53-icelandic-ep10-1000h" is an acoustic model suitable for Automatic Speech Recognition in Icelandic. It is the result of fine-tuning the model "facebook/wav2vec2-large-xlsr-53" for 10 epochs with around 1000 hours of Icelandic data developed by the [Language and Voice Laboratory](https://huggingface.co/language-and-voice-lab). Most of the data is available at public repositories such as [LDC](https://www.ldc.upenn.edu/), [OpenSLR](https://openslr.org/) or [Clarin.is](https://clarin.is/)
  
  The specific list of corpora used to fine-tune the model is:
  
  - [Samrómur 21.05 (114h34m)](http://www.openslr.org/112/)
  - [Samrómur Children (127h25m)](https://catalog.ldc.upenn.edu/LDC2022S11)
  - [Malrómur (119hh03m)](https://clarin.is/en/resources/malromur/)
  - [Althingi Parliamentary Speech (514h29m)](https://catalog.ldc.upenn.edu/LDC2021S01)
  - L2-Speakers Data (125h55m) **Unpublished material**
  	
  The fine-tuning process was performed during December (2022) in the servers of the Language and Voice Laboratory (https://lvl.ru.is/) at Reykjavík University (Iceland) by Carlos Daniel Hernández Mena.
  
  # Evaluation
  ```python
  import torch
  from transformers import Wav2Vec2Processor
  from transformers import Wav2Vec2ForCTC
  
  #Load the processor and model.
  MODEL_NAME="carlosdanielhernandezmena/wav2vec2-large-xlsr-53-icelandic-ep10-1000h"
  processor = Wav2Vec2Processor.from_pretrained(MODEL_NAME)
  model = Wav2Vec2ForCTC.from_pretrained(MODEL_NAME)
  
  #Load the dataset
  from datasets import load_dataset, load_metric, Audio
  ds=load_dataset("language-and-voice-lab/samromur_children", split="test")
  
  #Downsample to 16kHz
  ds = ds.cast_column("audio", Audio(sampling_rate=16_000))
  
  #Process the dataset
  def prepare_dataset(batch):
      audio = batch["audio"]
      #Batched output is "un-batched" to ensure mapping is correct
      batch["input_values"] = processor(audio["array"], sampling_rate=audio["sampling_rate"]).input_values[0]
      with processor.as_target_processor():
          batch["labels"] = processor(batch["normalized_text"]).input_ids
      return batch
  ds = ds.map(prepare_dataset, remove_columns=ds.column_names,num_proc=1)
  
  #Define the evaluation metric
  import numpy as np
  wer_metric = load_metric("wer")
  de