carlosdanielhernandezmena commited on
Commit
54e1fa0
1 Parent(s): 623eade

Adding info to the README file

Browse files
Files changed (1) hide show
  1. README.md +104 -0
README.md CHANGED
@@ -1,3 +1,107 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
2
  license: cc-by-4.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language: fo
3
+ datasets:
4
+ - carlosdanielhernandezmena/ravnursson_asr
5
+ tags:
6
+ - audio
7
+ - automatic-speech-recognition
8
+ - faroese
9
+ - whisper-tiny
10
+ - ravnur-project
11
+ - faroe-islands
12
  license: cc-by-4.0
13
+ widget: null
14
+ model-index:
15
+ - name: whisper-tiny-faroese-8k-steps-100h
16
+ results:
17
+ - task:
18
+ name: Automatic Speech Recognition
19
+ type: automatic-speech-recognition
20
+ dataset:
21
+ name: Ravnursson (Test)
22
+ type: carlosdanielhernandezmena/ravnursson_asr
23
+ split: test
24
+ args:
25
+ language: fo
26
+ metrics:
27
+ - name: WER
28
+ type: wer
29
+ value: 61.95
30
+ - task:
31
+ name: Automatic Speech Recognition
32
+ type: automatic-speech-recognition
33
+ dataset:
34
+ name: Ravnursson (Dev)
35
+ type: carlosdanielhernandezmena/ravnursson_asr
36
+ split: validation
37
+ args:
38
+ language: fo
39
+ metrics:
40
+ - name: WER
41
+ type: wer
42
+ value: 63.79
43
  ---
44
+ # whisper-tiny-faroese-8k-steps-100h
45
+ The "whisper-tiny-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-tiny" with 100 hours of Faroese data released by the Ravnur Project (https://maltokni.fo/en/) from the Faroe Islands.
46
+
47
+ 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.
48
+
49
+ 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.
50
+
51
+ # Evaluation
52
+ ```python
53
+ import torch
54
+ from transformers import WhisperForConditionalGeneration, WhisperProcessor
55
+
56
+ #Load the processor and model.
57
+ MODEL_NAME="carlosdanielhernandezmena/whisper-tiny-faroese-8k-steps-100h"
58
+ processor = WhisperProcessor.from_pretrained(MODEL_NAME)
59
+ model = WhisperForConditionalGeneration.from_pretrained(MODEL_NAME).to("cuda")
60
+
61
+ #Load the dataset
62
+ from datasets import load_dataset, load_metric, Audio
63
+ ds=load_dataset("carlosdanielhernandezmena/ravnursson_asr",split='test')
64
+
65
+ #Downsample to 16kHz
66
+ ds = ds.cast_column("audio", Audio(sampling_rate=16_000))
67
+
68
+ #Process the dataset
69
+ def map_to_pred(batch):
70
+ audio = batch["audio"]
71
+ input_features = processor(audio["array"], sampling_rate=audio["sampling_rate"], return_tensors="pt").input_features
72
+ batch["reference"] = processor.tokenizer._normalize(batch['normalized_text'])
73
+
74
+ with torch.no_grad():
75
+ predicted_ids = model.generate(input_features.to("cuda"))[0]
76
+
77
+ transcription = processor.decode(predicted_ids)
78
+ batch["prediction"] = processor.tokenizer._normalize(transcription)
79
+
80
+ return batch
81
+
82
+ #Do the evaluation
83
+ result = ds.map(map_to_pred)
84
+
85
+ #Compute the overall WER now.
86
+ from evaluate import load
87
+
88
+ wer = load("wer")
89
+ WER=100 * wer.compute(references=result["reference"], predictions=result["prediction"])
90
+ print(WER)
91
+ ```
92
+ **Test Result**: 61.9550858652576
93
+
94
+ # BibTeX entry and citation info
95
+ * When publishing results based on these models please refer to:
96
+ ```bibtex
97
+ @misc{mena2023whispertinyfaroese,
98
+ title={Acoustic Model in Faroese: whisper-tiny-faroese-8k-steps-100h.},
99
+ author={Hernandez Mena, Carlos Daniel},
100
+ year={2023},
101
+ url={https://huggingface.co/carlosdanielhernandezmena/whisper-tiny-faroese-8k-steps-100h},
102
+ }
103
+ ```
104
+ # Acknowledgements
105
+ 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.
106
+
107
+ Special 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