End-to-end Automatic Speech Recognition (ASR) pipeline for the Wolof language,
fine-tuned from facebook/wav2vec2-xls-r-300m on the IndabaX Senegal corpus.
Ready-to-use model published on Hugging Face: Bakis/ASR-Model-Wav2vec2
---
## Overview
Wolof is a language spoken by over 10 million people, primarily in Senegal, Gambia and Mauritania. Publicly available speech recognition models for Wolof remain scarce compared to high-resource languages.
This project fine-tunes **Wav2Vec2 XLS-R 300M** — a cross-lingual self-supervised speech representation model — on the IndabaX Senegal ASR dataset, and delivers a full training + evaluation + inference pipeline usable end-to-end.
**Best test result: WER ≈ 0.39** on the held-out test set.
---
## Pipeline
| Step | What happens | Module |
|---|---|---|
| **1. Data** | Load train, validation and held-out test splits at 16 kHz | `src/data.py` |
| **2. Preprocessing** | Text cleaning, stationary noise reduction, length filtering (1–18 s, 4–310 tokens) | `src/preprocessing.py` |
| **3. Tokenizer** | Custom character-level vocabulary for Wolof (basic Latin + diacritics + `ŋ`, `ñ`) | `src/vocab.py` |
| **4. Model** | `Wav2Vec2ForCTC` with frozen feature extractor and CTC head | `src/model.py` |
| **5. Training** | 16 epochs, batch size 8, lr 1e-4, cosine scheduler, fp16, early stopping | `src/trainer_setup.py` |
| **6. Evaluation** | WER / CER / accuracy / macro-precision, error analysis | `src/metrics.py` · `src/evaluation.py` |
| **7. Inference** | Transcribe any audio file with optional denoising | `src/inference.py` |
---
## Project structure
```text
asr-wolof-speech-recognition/
├── README.md
├── LICENSE
├── requirements.txt
├── .gitignore
│
├── notebooks/
│ └── wolof_asr_training.ipynb Full exploratory notebook
│
├── src/ Modular pipeline
│ ├── config.py Central hyperparameters
│ ├── seeding.py Reproducibility
│ ├── data …