
Spoken Language Identification — Intelligent input routing.Akuapim Twi (Akuapim-twi), Asante Twi (Asante-twi), Tunisian Arabic (aeb), Afrikaans (afr), Amharic (amh), Arabic (ara), Basaa (bas), Bemba (bem), Taita (dav), Dyula (dyu), English (eng), Nigerian Pidgin (eng-zul), Ewe (ewe), Fanti (fat), Fon (fon), Pulaar (fuc), Pular (fuf), Ga (gaa), Hausa (hau), Igbo (ibo), Kabyle (kab), Kinyarwanda (kin), Kalenjin (kln), Lingala (lin), Lozi (loz), Luganda (lug), Luo (luo), Western Maninkakan (mlq), South Ndebele (nbl), Northern Sotho (nso), Chichewa (nya), Southern Sotho (sot), Serer (srr), Swati (ssw), Susu (sus), Kiswahili (swa), Swahili (swh), Tigre (tig), Tigrinya (tir), Tonga (toi), Tswana (tsn), Tsonga (tso), Twi (twi), Venda (ven), Wolof (wol), Xhosa (xho), Yoruba (yor), Standard Moroccan Tamazight (zgh), Zulu (zul)
| SLID Model | Architecture | Hugging Face Card | Status |
|---|---|---|---|
| Simba-SLID-49 🔍 | HuBERT | 🤗 https://huggingface.co/UBC-NLP/Simba-SLIS-49 | ✅ Released |
transformers library.1from transformers import (
2 HubertForSequenceClassification,
3 AutoFeatureExtractor,
4 AutoProcessor
5)
6import torch
7
8model_id = "UBC-NLP/Simba-SLIS_49"
9model = HubertForSequenceClassification.from_pretrained(model_id).to("cuda")
10# HuBERT models can use either processor or feature extractor depending on the specific model
11try:
12 processor = AutoProcessor.from_pretrained(model_id)
13 print("Loaded Simba-SLIS_49 model with AutoProcessor")
14except:
15 processor = AutoFeatureExtractor.from_pretrained(model_id)
16 print("Loaded Simba-SLIS_49 model with AutoFeatureExtractor")
17
18# Optimize model for inference
19model.eval()
20audio_arrays = [] ### add your audio array
21sample_rate=16000
22
23nputs = processor(audio_arrays, sampling_rate=sample_rate, return_tensors="pt", padding=True).to("cuda")
24
25# Different models might have slightly different input formats
26try:
27 logits = model(**inputs).logits
28except Exception as e:
29 # Try alternative input format if the first attempt fails
30 if "input_values" in inputs:
31 logits = model(input_values=inputs.input_values).logits
32 else:
33 raise e
34
35# Calculate softmax probabilities
36probs = torch.nn.functional.softmax(logits, dim=-1)
37
38# Get the maximum probability (confidence) for each prediction
39confidence_values, pred_ids = torch.max(probs, dim=-1)
40
41# Convert to Python lists
42pred_ids = pred_ids.tolist()
43confidence_values = confidence_values.cpu().tolist()
44# Get labels from IDs
45pred_labels = [model.config.id2label[i] for i in pred_ids]
46
47
48print(pred_labels, confidence_values)1
2@inproceedings{elmadany-etal-2025-voice,
3 title = "Voice of a Continent: Mapping {A}frica{'}s Speech Technology Frontier",
4 author = "Elmadany, AbdelRahim A. and
5 Kwon, Sang Yun and
6 Toyin, Hawau Olamide and
7 Alcoba Inciarte, Alcides and
8 Aldarmaki, Hanan and
9 Abdul-Mageed, Muhammad",
10 editor = "Christodoulopoulos, Christos and
11 Chakraborty, Tanmoy and
12 Rose, Carolyn and
13 Peng, Violet",
14 booktitle = "Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing",
15 month = nov,
16 year = "2025",
17 address = "Suzhou, China",
18 publisher = "Association for Computational Linguistics",
19 url = "https://aclanthology.org/2025.emnlp-main.559/",
20 doi = "10.18653/v1/2025.emnlp-main.559",
21 pages = "11039--11061",
22 ISBN = "979-8-89176-332-6",
23}
24