Table of Contents

Click to expand

Model Description

This is a HuBERT Base model pre-trained using 6,000 hours of Iberian languages speech data (Spanish, Catalan, Basque, Galician, Aranese, plus English). The model architecture is the same as the original HuBERT Base model, which contains 12 transformer layers. Pre-training was done by Barcelona Supercomputing Center.

Intended Uses and Limitations

This pre-trained model generates Speech Representations that can be used for any Iberian speech-related task. This model does not have a tokenizer as it was pretrained on audio alone.

In order to use this model for Automatic Speech Recognition, a tokenizer should be created and the model should be fine-tuned on labeled text data. Check out this blog for more in-detail explanation of how to fine-tune the model for Speech Recognition. For an explanation of how to fine-tune the model for Audio Classification, check out this tutorial.

Pre-training Details

This model was pre-trained using code from the official repository, and the detailed training configuration can be found in the same repository and the original paper.

For pre-training, a 6,000 hours dataset was created using subsets from training splits from the following datasets:

Dataset Language Selected hours Comments
Basque Parliament Speech Corpus 1.0 Spanish 343
VoxPopuli Spanish 151
CommonVoice 23 Spanish 506
IB3 - Speech Corpus for Catalan-varieties ASR Catalan 28 This dataset is private and is planned to be published as public soon.
parlament_parla_v3 Catalan 90 This dataset is private and is planned to be published as public soon.
Corts Valencianes Catalan 90 Only the anonymized version of the dataset is public. We trained the model with the non-anonymized version.
CommonVoice 23 Catalan 112
Catalan Youtube Speech Catalan 340
3CatParla Catalan 340 This dataset is private and is planned to be published as public soon.
Nos_Celtia-GL Galician 24
Nos_Transcrispeech-GL Galician 35
CommonVoice 23 Galician 156
Nos_RG-Podcast-GL Galician 258
Nos_ParlaSpeech-GL Galician 527
Basque Parliament Speech Corpus 1.0 Basque 427
CommonVoice 23 Basque 431
3Cat_aranese Aranese 1000 This dataset is private and is planned to be published as public soon.
VoxPopuli English 500
CommonVoice 23 English 500

Indirect evaluation results

To assess the pre-trained Speech Representations' quality, we evaluated them using two indirect tasks: Automatic Speech Recognition (ASR) and Language Identification (LID).

Automatic Speech Recognition

For each language (Spanish, Catalan, Basque, Galician, Aranese, and English), we created train and validation ASR-labelled datasets using 50 hours subsamples from Common Voice train splits (except for Aranese, were we used 2 hours of Aranese, plus 30 hours of Catalan). For testing, we used each language Common Voice test split.

We fine-tuned on this ASR-labelled training splits the following models:

All of these models were pre-trained using exactly the same configurations. We trained them for 20 epochs. For the fine-tuning process, we froze models' parameters using the freeze_feature_encoder() method. All models have 94M parameters, 95% of them were fine-tuned. The results were the following:

Model Avg WER ↑ Spanish WER Catalan WER Basque WER Galician WER Aranese WER English WER
hubert-base-los-6k 22.4% 17.3% 17.6% 10.6% 11.4% 31.4% 46.0%
mHuBERT-147 24.7% 21.4% 22.6% 15.3% 15.8% 38.7% 34.6%
hubert-base-los-2k 25.7% 16.7% 17.5% 9.1% 11.4% 44.3% 55.5%

Language Identification

We created train and validation Language Identification labelled splits using subsamples from each language Common Voice train split. That is, we randomly selected 5 hours for Spanish, 5 hours for Catalan, 5 hours for Basque, 5 hours for Galician, 5 hours for English and 2 hours for Aranese. For testing, we created a test split concatenating all the Spanish, Catalan, Basque, Galician, Aranese and English test splits from Common Voice.

We fine-tuned on this 22 hours labelled training split the following models:

All of these models were pre-trained using exactly the same configurations. We trained them for 10 epochs. For the fine-tuning process, we froze models' parameters using the freeze_base_model() method. All the models have 94M parameters, 0.2% of them were fine-tuned.

The results were the following:

Model F1-score Macro ↓ Spanish F1-score Catalan F1-score Basque F1-score Galician F1-score Aranese F1-score English F1-score
hubert-base-los-6k 80.5% 91.2% 90.4% 98.8% 90.3% 15.0% 97.5%
hubert-base-los-2k 80.3% 92.2% 90.2% 98.9% 94.1% 12.9% 93.8%
mHuBERT-147 72.3% 82.7% 83.5% 91.1% 75.2% 7.3% 93.9%

How to use the model

Speech Representations

To obtain Speech Representations (HuBERT outputs) from audio in Iberian languages using this model, you can follow this example:

(Using fsspec==2025.3.0, datasets==3.6.0 and transformers==4.52.2 is recomended).


from datasets import load_dataset, Audio
import torch
from transformers import AutoFeatureExtractor, AutoModel

#Load the dataset
dataset = load_dataset("projecte-aina/ib3_ca_asr", split='train[:1%]', trust_remote_code=True)

#Downsample to 16kHz
dataset = dataset.cast_column("audio", Audio(sampling_rate=16_000))

# Hugginface pre-trained model path
MODEL_NAME = "BSC-LT/hubert-base-los-6k"

# Set device
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print(f"Using {device} device.")

# Load feature extractor
feature_extractor = AutoFeatureExtractor.from_pretrained(MODEL_NAME)

# Load model
model = AutoModel.from_pretrained(MODEL_NAME)
model = model.to(device)

def map_to_speech_representations(batch):

  #Process the dataset
  audio = batch["audio"]
  input_features = feature_extractor(audio["array"], sampling_rate=audio["sampling_rate"], return_tensors="pt").input_values
  input_features = input_features.to(device)

  # Extract HuBERT's Speech Representations
  with torch.no_grad():
    outputs = model(
        input_features,
        output_hidden_states = True,
        )
    speech_representations = outputs.last_hidden_state
    hidden_states = outputs.hidden_states

  batch["speech_representations"] = speech_representations
  batch["hidden_states"] = hidden_states

  return batch

dataset = dataset.map(map_to_speech_representations)

print(dataset)

Discrete Speech Representations

Important remark: the k-means model available in this repo and used for extracting Discrete Speech Representations was trained using HuBERT's 6th layer.

To obtain Discrete Speech Representations (HuBERT's k-means centroids) from audio in Iberian languages using this model, you can follow this example:

(Using fsspec==2025.3.0, datasets==3.6.0 and transformers==4.52.2 is recomended).


from datasets import load_dataset, Audio
import torch
from transformers import AutoFeatureExtractor, AutoModel
import joblib
import numpy as np
from huggingface_hub import hf_hub_download

#Load the dataset
dataset = load_dataset("projecte-aina/ib3_ca_asr", split='train[:1%]', trust_remote_code=True)

#Downsample to 16kHz
dataset = dataset.cast_column("audio", Audio(sampling_rate=16_000))

# Hugginface pre-trained model path
MODEL_NAME = "BSC-LT/hubert-base-los-6k"

# Set device
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print(f"Using {device} device.")

# Load feature extractor
feature_extractor = AutoFeatureExtractor.from_pretrained(MODEL_NAME)

# Load model
model = AutoModel.from_pretrained(MODEL_NAME)
model = model.to(device)

# Load k-means
km_path = hf_hub_download(repo_id="BSC-LT/hubert-base-los-2k", filename="k_means.km")
km_model = joblib.load(km_path)
clusters = km_model.cluster_centers_

def map_to_discrete_units(batch):

  #Process the dataset
  audio = batch["audio"]
  input_features = feature_extractor(audio["array"], sampling_rate=audio["sampling_rate"], return_tensors="pt").input_values
  input_features = input_features.to(device)

  
  with torch.no_grad():
    outputs = model(
        input_features,
        output_hidden_states = True,
        )
    
    # Extract HuBERT's Speech Representations
    hidden_states = outputs.hidden_states

    # Extract 6-th layer features
    k_means_input = hidden_states[5].squeeze()
    k_means_input = k_means_input.cpu()
    k_means_input = np.array(k_means_input, dtype='f')
    
    labels = km_model.predict(k_means_input)
    batch["discrete_units"] = clusters[labels]

  return batch

dataset = dataset.map(map_to_discrete_units)

print(dataset)

Automatic Speech Recognition

In order to use this model for Speech Recognition, a tokenizer should be created and the model should be fine-tuned on labeled text data. Check out this blog for more in-detail explanation of how to fine-tune the model for Speech Recognition.

Audio Classification

For an explanation of how to fine-tune the model for Audio Classification, check out this tutorial.

Citation

If this model contributes to your research, please cite the work:

@misc{costa2026hubertbaselos6k,
      title={LOSHuBERT: the first full Iberian pre-trained HuBERT.}, 
      author={Costa, Federico; Messaoudi, Abir; Peiró-Lilja, Alex; Casals-Salvador, Marc; España-Bonet, Cristina},
      organization={Barcelona Supercomputing Center},
      url={https://huggingface.co/BSC-LT/hubert-base-los-6k},
      year={2026}
}

Additional Information

Author

The Speech team of the Barcelona Supercomputing Center.

Contact

For further information, please send an email to bsc-lt@bsc.es.

Copyright

Copyright(c) 2026 by AI Institute, Barcelona Supercomputing Center.

License

RAIL Research use

Funding

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 Desarrollo de Modelos ALIA.

The training of the model was possible thanks to the computing time provided by Barcelona Supercomputing Center through MareNostrum 5. We acknowledge EuroHPC Joint Undertaking for awarding us access to MareNostrum5 as BSC, Spain.

Acknowledgements

We acknowledge the following collaborations:

  • Proxecto Nós (Instituto da Lingua Galega, USC), for developing Nos_RG-Podcast-GL, Nos_ParlaSpeech-GL, Nos_Transcrispeech-GL, Nos_Celtia-GL datasets.
  • The Corts Valencianes data have been collected thanks to the intervention of the NEL-VIVES campaign, an initiative developed by Cenid, the Digital Intelligence Center of the University of Alicante.
Downloads last month
14
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for BSC-LT/hubert-base-los-6k

Finetuned
(152)
this model

Datasets used to train BSC-LT/hubert-base-los-6k

Collection including BSC-LT/hubert-base-los-6k