Predict Hausa, Igbo, or Yoruba from English accent audio
# Native Language Accent Classifier (Hausa, Igbo, Yoruba)
A compact, reproducible pipeline that classifies a speaker's native language (Hausa, Igbo, Yoruba) from short audio samples using engineered audio features (MFCCs, pitch, ZCR, spectral contrast) and a K-Nearest Neighbors (KNN) model. The repository contains audio collection utilities, preprocessing, feature extraction, training/evaluation code in a notebook, saved feature CSVs, and a Streamlit demo app.
Key goals
- Reliable feature extraction from short audio samples.
- Reproducible preprocessing and augmentation / bootstrapping.
- Simple, explainable baseline model for rapid iteration and demo.
Primary code symbols (open these for details)
- `app.extract_features`: feature extraction used in the Streamlit app. See app.py.
- `native_language_accent.preprocess_audio`: audio conversion, normalization, trimming routine. See native_language_accent.ipynb.
- `native_language_accent.extract_features`: dataset feature extraction loop (13 MFCC means, pitch mean/std, zcr, 7 spectral contrast means). See native_language_accent.ipynb.
- `native_language_accent.download_audio`: YouTube/shorts download helper used to populate data/. See native_language_accent.ipynb.
Quick start
1) Prerequisites
- Python 3.8+ (tested).
- System dependency: ffmpeg (required by pydub).
- Recommended: create a virtual environment.
2) Install Python dependencies
Run:
```bash
python -m pip install -U pip
python -m pip install numpy pandas librosa scikit-learn matplotlib seaborn pydub yt_dlp streamlit joblib
```
Or:
```bash
python -m pip install -r requirements.txt
```
(If you add a requirements file, put it at repo root.)
3) Reproduce feature extraction and training (recommended)
- Open and run native_language_accent.ipynb.
- Use `native_language_accent.preprocess_audio` to convert files from data/ into processed_data/.
- Use `native_language_accent.extract_features` to build `accent_features.csv`. …