Downloads · 30 days
9
10% of all-time downloads
keystats/w2v-bert-2.0-lang-id-lug-sna-lin
w2v-bert-2.0-lang-id-lug-sna-lin is a audio classification model from keystats. Use it for the audio classification task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
A spoken language identification (LID) model that classifies short audio clips into one of three languages — Luganda, Shona, or Lingala — fine-tuned from facebook/w2v-bert-2.0 with a sequence classification head, trai…
Downloads · 30 days
9
10% of all-time downloads
All-time downloads
93
Public
Parameters
581M
2.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.3 GB · 100%
From the Hugging Face model README
A spoken language identification (LID) model that classifies short audio clips into one of three languages — Luganda, Shona, or Lingala — fine-tuned from facebook/w2v-bert-2.0 with a sequence classification head, trained on the WAXAL corpus only.
facebook/w2v-bert-2.0 — a large-scale, multilingual self-supervised
speech encoder pretrained with a BERT-style masked prediction
objective — is used as the backbone, with a from-scratch audio
classification head fine-tuned to predict which of the three
languages a given audio clip is spoken in. Unlike the companion ASR
models in this collection, this model does not transcribe speech — it
only outputs a language label.
| Source | Role |
|---|---|
| google/WaxalNLP — Luganda, Shona, Lingala configs | train splits from all three language configs pooled together (each clip labeled with its language) for training; validation splits pooled together and held out for monitoring |
Only WAXAL data was used — no additional community datasets were pooled in.
facebook/w2v-bert-2.0Wav2Vec2BertForSequenceClassification (audio
classification head over the pretrained encoder), 3 output classes
(Luganda, Shona, Lingala)This model achieved perfect accuracy (100%) on both the validation and test splits, correctly classifying every clip across all three languages.
Note: Perfect accuracy on a 3-way language ID task like this is plausible — Luganda, Shona, and Lingala are phonologically quite distinct from each other, which makes the classification task much easier than, say, distinguishing closely related dialects. As always, treat in-domain WAXAL numbers as an upper bound rather than a guarantee of real-world performance on out-of-domain audio.
import torch
import librosa
from transformers import Wav2Vec2BertForSequenceClassification, Wav2Vec2BertProcessor
MODEL_ID = "keystats/w2v-bert-2.0-lang-id-lug-sna-lin"
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
processor = Wav2Vec2BertProcessor.from_pretrained(MODEL_ID)
model = Wav2Vec2BertForSequenceClassification.from_pretrained(MODEL_ID).to(DEVICE).eval()
audio_array, sr = librosa.load("path/to/audio.wav", sr=16000, mono=True)
inputs = processor(audio_array, sampling_rate=16000, return_tensors="pt")
with torch.no_grad():
logits = model(input_features=inputs.input_features.to(DEVICE)).logits
predicted_id = torch.argmax(logits, dim=-1).item()
predicted_label = model.config.id2label[predicted_id]
print(predicted_label) # "luganda", "shona", or "lingala"
-main-best checkpoints in this collection).If you use this model, please cite the training/fine-tuning work and the underlying dataset:
@misc{keystats_wav2vec2bert_langid_lug_sna_lin,
title={w2v-bert-2.0-lang-id-lug-sna-lin: A Luganda/Shona/Lingala spoken language identification model fine-tuned from facebook/w2v-bert-2.0},
author={keystats},
year={2026},
howpublished={\url{https://huggingface.co/keystats/w2v-bert-2.0-lang-id-lug-sna-lin}}
}
@misc{waxal,
title={WAXAL: A Multilingual African Speech Dataset},
author={Google},
howpublished={\url{https://huggingface.co/datasets/google/WaxalNLP}}
}
@inproceedings{w2vbert2,
title={Seamless: Multilingual Expressive and Streaming Speech Translation},
author={Seamless Communication and others},
year={2023},
howpublished={\url{https://huggingface.co/facebook/w2v-bert-2.0}}
}