File size: 6,323 Bytes
e4e1cad
2a21dfe
 
1d4211f
2a21dfe
 
 
 
 
 
 
 
 
e4e1cad
2a21dfe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e4e1cad
2a21dfe
 
9c9b360
2a21dfe
6e8da3e
2a21dfe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f37c9c1
2a21dfe
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
---
language: is
datasets:
- language-and-voice-lab/samromur_milljon
tags:
- audio
- automatic-speech-recognition
- icelandic
- whisper
- whisper-large
- iceland
- reykjavik
- samromur
license: cc-by-4.0
model-index:
- name: whisper-large-icelandic-62640-steps-967h
  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: 7.762
  - 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: 7.035
  - 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: 7.047
  - 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: 4.425
  - 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: 11.511
  - 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: 11.000
  - 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: 16.189
  - 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: 16.007
---
# whisper-large-icelandic-62640-steps-967h

The "whisper-large-icelandic-62640-steps-967h" is an acoustic model suitable for Automatic Speech Recognition in Icelandic. It is the result of fine-tuning the model [openai/whisper-large](https://huggingface.co/openai/whisper-large) for 62,640 steps with 967 hours of Icelandic data collected by the [Language and Voice Laboratory](https://huggingface.co/language-and-voice-lab) through the platform [Samrómur](https://samromur.is/).

The specific data that was used to fine-tune the model is the corpus [Samrómur Milljón](https://huggingface.co/datasets/language-and-voice-lab/samromur_milljon), which is the result of the automatic verification of 1 million of recordings comming from the corpus ["Samromur Unverified 22.07"](http://hdl.handle.net/20.500.12537/265). It has to be pointed out that this model was trained with different data than our previous model [whisper-large-icelandic-30k-steps-1000h](https://huggingface.co/language-and-voice-lab/whisper-large-icelandic-30k-steps-1000h).
	
The fine-tuning process was performed during June (2023) in the servers of the Language and Voice Laboratory (https://lvl.ru.is/) at Reykjavík University (Iceland) by [Carlos Daniel Hernández Mena](https://huggingface.co/carlosdanielhernandezmena).

# Evaluation
```python
import torch
from transformers import WhisperForConditionalGeneration, WhisperProcessor

#Load the processor and model.
MODEL_NAME="language-and-voice-lab/whisper-large-icelandic-62640-steps-967h"
processor = WhisperProcessor.from_pretrained(MODEL_NAME)
model = WhisperForConditionalGeneration.from_pretrained(MODEL_NAME).to("cuda")

#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 map_to_pred(batch):
	audio = batch["audio"]
	input_features = processor(audio["array"], sampling_rate=audio["sampling_rate"], return_tensors="pt").input_features
	batch["reference"] = processor.tokenizer._normalize(batch['normalized_text'])

	with torch.no_grad():
		predicted_ids = model.generate(input_features.to("cuda"))[0]
	
	transcription = processor.decode(predicted_ids)
	batch["prediction"] = processor.tokenizer._normalize(transcription)
	
	return batch
	
#Do the evaluation
result = ds.map(map_to_pred)

#Compute the overall WER now.
from evaluate import load

wer = load("wer")
WER=100 * wer.compute(references=result["reference"], predictions=result["prediction"])
print(WER)
```
**Test Result**: 7.743795695602924

# BibTeX entry and citation info
*When publishing results based on these models please refer to:*
```bibtex
@misc{mena2023whisperlarge62640icelandic,
      title={Acoustic Model in Icelandic: whisper-large-icelandic-62640-steps-967h.}, 
      author={Hernandez Mena, Carlos Daniel},
      url={https://huggingface.co/language-and-voice-lab/whisper-large-icelandic-62640-steps-967h},
      year={2023}
}
```

# Acknowledgements

Thanks to Jón Guðnason, head of the Language and Voice Lab for providing computational power to make this model possible.

We also want to thank to the "Language Technology Programme for Icelandic 2019-2023" which is managed and coordinated by Almannarómur, and it is funded by the Icelandic Ministry of Education, Science and Culture. This model is an unexpected result of all the resources gathered by the Programme. 

Special thanks to Björn Ingi Stefánsson for setting up the configuration of the server where this model was trained.