File size: 4,285 Bytes
d48af6b
13a4888
 
 
 
 
 
 
 
 
 
 
d48af6b
13a4888
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d48af6b
13a4888
a07c81e
 
13a4888
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8dd2d1c
13a4888
 
 
 
 
 
 
 
 
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
---
language: fo
datasets:
  - carlosdanielhernandezmena/ravnursson_asr
tags:
  - audio
  - automatic-speech-recognition
  - faroese
  - whisper-large
  - whisper-large-v1
  - ravnur-project
  - faroe-islands
license: cc-by-4.0
model-index:
  - name: whisper-large-faroese-8k-steps-100h
    results:
      - task:
          name: Automatic Speech Recognition
          type: automatic-speech-recognition
        dataset:
          name: Ravnursson (Test)
          type: carlosdanielhernandezmena/ravnursson_asr
          split: test
          args:
            language: fo
        metrics:
          - name: WER
            type: wer
            value: 6.889
      - task:
          name: Automatic Speech Recognition
          type: automatic-speech-recognition
        dataset:
          name: Ravnursson (Dev)
          type: carlosdanielhernandezmena/ravnursson_asr
          split: validation
          args:
            language: fo
        metrics:
          - name: WER
            type: wer
            value: 5.054
---
# whisper-large-faroese-8k-steps-100h
**Paper:** [ASR Language Resources for Faroese](https://aclanthology.org/2023.nodalida-1.4.pdf)

The "whisper-large-faroese-8k-steps-100h" is an acoustic model suitable for Automatic Speech Recognition in Faroese. It is the result of fine-tuning the model "openai/whisper-large" with 100 hours of Faroese data released by the Ravnur Project (https://maltokni.fo/en/) from the Faroe Islands.

The specific dataset used to create the model is called "Ravnursson Faroese Speech and Transcripts" and it is available at http://hdl.handle.net/20.500.12537/276.

The fine-tuning process was perform during March (2023) in the servers of the Language and Voice Lab (https://lvl.ru.is/) at Reykjavík University (Iceland) by Carlos Daniel Hernández Mena.

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

#Load the processor and model.
MODEL_NAME="carlosdanielhernandezmena/whisper-large-faroese-8k-steps-100h"
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("carlosdanielhernandezmena/ravnursson_asr",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**: 6.88978359335682

# BibTeX entry and citation info
* When publishing results based on these models please refer to:
```bibtex
@misc{mena2023whisperlargefaroese,
      title={Acoustic Model in Faroese: whisper-large-faroese-8k-steps-100h.}, 
      author={Hernandez Mena, Carlos Daniel},
      url={https://huggingface.co./carlosdanielhernandezmena/whisper-large-faroese-8k-steps-100h},
      year={2023}
}
```
# Acknowledgements
We want to thank 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.

Thanks to Annika Simonsen and to The Ravnur Project for making their "Basic Language Resource Kit"(BLARK 1.0) publicly available through the research paper "Creating a Basic Language Resource Kit for Faroese" https://aclanthology.org/2022.lrec-1.495.pdf

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