|
--- |
|
language: mt |
|
datasets: |
|
- common_voice |
|
tags: |
|
- audio |
|
- automatic-speech-recognition |
|
- maltese |
|
- whisper-large-v2 |
|
- masri-project |
|
- malta |
|
- university-of-malta |
|
license: cc-by-nc-sa-4.0 |
|
widget: null |
|
model-index: |
|
- name: whisper-largev2-maltese-8k-steps-64h |
|
results: |
|
- task: |
|
name: Automatic Speech Recognition |
|
type: automatic-speech-recognition |
|
dataset: |
|
name: MASRI-TEST Corpus |
|
type: MLRS/masri_test |
|
split: test |
|
args: |
|
language: mt |
|
metrics: |
|
- name: WER |
|
type: wer |
|
value: 19.83 |
|
- task: |
|
name: Automatic Speech Recognition |
|
type: automatic-speech-recognition |
|
dataset: |
|
name: MASRI-DEV Corpus |
|
type: MLRS/masri_dev |
|
split: validation |
|
args: |
|
language: mt |
|
metrics: |
|
- name: WER |
|
type: wer |
|
value: 19.734 |
|
--- |
|
|
|
# whisper-largev2-maltese-8k-steps-64h |
|
|
|
The "whisper-largev2-maltese-8k-steps-64h" is an acoustic model suitable for Automatic Speech Recognition in Maltese. It is the result of fine-tuning the model "openai/whisper-large-v2" with around 64 hours of Maltese data developed by the MASRI Project at the University of Malta between 2019 and 2021. Most of the data is available at the the MASRI Project homepage https://www.um.edu.mt/projects/masri/. |
|
|
|
The specific list of corpora used to fine-tune the model is: |
|
|
|
- MASRI-HEADSET v2 (6h39m) |
|
- MASRI-Farfield (9h37m) |
|
- MASRI-Booths (2h27m) |
|
- MASRI-MEP (1h17m) |
|
- MASRI-COMVO (7h29m) |
|
- MASRI-TUBE (13h17m) |
|
- MASRI-MERLIN (25h18m) *Not available at the MASRI Project homepage |
|
|
|
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-largev2-maltese-8k-steps-64h" |
|
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("MLRS/masri_test",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**: 19.830687830687832 |
|
|
|
# BibTeX entry and citation info |
|
*When publishing results based on these models please refer to:* |
|
```bibtex |
|
@misc{mena2023whisperlargev2maltese, |
|
title={Acoustic Model in Maltese: whisper-largev2-maltese-8k-steps-64h.}, |
|
author={Hernandez Mena, Carlos Daniel}, |
|
year={2023}, |
|
url={https://huggingface.co/carlosdanielhernandezmena/whisper-largev2-maltese-8k-steps-64h}, |
|
} |
|
``` |
|
|
|
# Acknowledgements |
|
|
|
The MASRI Project is funded by the University of Malta Research Fund Awards. We want to thank to Merlin Publishers (Malta) for provinding the audiobooks used to create the MASRI-MERLIN Corpus. |
|
|
|
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. |
|
|
|
Special thanks to Björn Ingi Stefánsson for setting up the configuration of the server where this model was trained. |