The LoS Whisper-large-v3 model is a multilingual automatic speech recognition (ASR) system designed to transcribe punctuated speech in Spanish, Catalan, Galician, and Euskera (LoS, Languages of Spain).
It is the result of fine-tuning the model openai/whisper-large-v3 on a combination of public and institutional datasets.
The model was trained on meticulously on 8,110 hours of preprocessed data. This ensures high-quality, readable transcriptions while preserving linguistic consistency.
The training hours were equalized across the four languages to ensure comparable performance. Speed Perturbation (0.9× and 1.1×) was applied to every Basque training audio file, with a total duration of 2027h 56m 11s, which then served as the reference for balancing the remaining languages.
Intended Uses and Limitations
This model can be used for automatic speech recognition in the four languages mentioned.
Limitations: Speakers’ demographic information is not available; biases may exist due to institutional content.
How to Get Started with the Model
To see a functional version of this code, please check our Notebook and, in order to invoke this model, just substitute the instances of "projecte-aina/whisper-large-v3-ca-3catparla" with "BSC-LT/whisper-large-v3-LoS-punctuated".
1#This code works with a GPU23#Notice that: load_metric is no longer part of datasets.4# You have to remove it and use evaluate's load instead.5#(Note from November 2024)67import torch
8from transformers import WhisperForConditionalGeneration, WhisperProcessor
910#Load the processor and model.11MODEL_NAME="BSC-LT/whisper-large-v3-LoS-punctuated"12processor = WhisperProcessor.from_pretrained(MODEL_NAME)13model = WhisperForConditionalGeneration.from_pretrained(MODEL_NAME).to("cuda")1415#Load the dataset16from datasets import load_dataset, load_metric, Audio
17ds=load_dataset("projecte-aina/parlament_parla",split='test')1819#Downsample to 16kHz20ds = ds.cast_column("audio", Audio(sampling_rate=16_000))2122#Process the dataset23defmap_to_pred(batch):24 audio = batch["audio"]25 input_features = processor(audio["array"], sampling_rate=audio["sampling_rate"], return_tensors="pt").input_features
26 batch["reference"]= processor.tokenizer._normalize(batch['normalized_text'])2728with torch.no_grad():29 predicted_ids = model.generate(input_features.to("cuda"))[0]3031 transcription = processor.decode(predicted_ids)32 batch["prediction"]= processor.tokenizer._normalize(transcription)3334return batch
3536#Do the evaluation37result = ds.map(map_to_pred)3839#Compute the overall WER now.40from evaluate import load
4142wer = load("wer")43WER=100* wer.compute(references=result["reference"], predictions=result["prediction"])44print(WER)
Training Details
Training data
The specific datasets used to create the model are:
In Catalan:
This work is funded by the Ministerio para la Transformación Digital y de la Función Pública - Funded by EU – NextGenerationEU within the framework of the project ILENIA with reference 2022/TL22/00215337.
The training of the model was possible thanks to the computing time provided by Barcelona Supercomputing Center through MareNostrum 5.