Skip to main content

Modèle ASR Whisper Small fine-tuné pour la transcription audio en Bambara (WER 37.38%)

Project description

whisper-bambara-sts

Modèle ASR (Automatic Speech Recognition) Whisper Small fine-tuné pour la transcription audio en bambara.

📊 Performance

Métrique Valeur
WER (Word Error Rate) 37.38%
CER (Character Error Rate) 16.45%
Dataset 50h de bambara (63,813 échantillons)
Modèle de base OpenAI Whisper Small (244M paramètres)
Taille du modèle ~480 MB (FP16)

🚀 Installation

pip install whisper-bambara-sts

Options d'installation

# Avec dépendances de développement
pip install whisper-bambara-sts[dev]

# Avec Gradio pour l'interface web
pip install whisper-bambara-sts[gradio]

# Toutes les dépendances
pip install whisper-bambara-sts[all]

💡 Utilisation

from whisper_bambara_sts import BambaraASR

# Initialisation (charge le modèle en mémoire)
asr = BambaraASR()  # mode="best" par défaut (beam search)

# Transcription simple
text = asr.transcribe("audio.wav")
print(text)
# → "Sira e tɔgɔ"

# Mode rapide (greedy decoding)
asr_fast = BambaraASR(mode="fast")
text = asr_fast.transcribe("audio.wav")

# Avec surcharge des paramètres
text = asr.transcribe("audio.wav", num_beams=10)

# Avec numpy array
import numpy as np
audio = np.random.randn(16000 * 5).astype(np.float32)  # 5 secondes
text = asr.transcribe(audio, sampling_rate=16000)

# Batch processing
files = ["audio1.wav", "audio2.wav", "audio3.wav"]
texts = asr.transcribe_batch(files)

CLI

# Transcription d'un fichier
bambara-sts audio.wav

# Mode rapide
bambara-sts audio.wav --mode fast

# Batch processing
bambara-sts --batch ./audios/

# Avec sortie fichier
bambara-sts audio.wav --output result.json

# Version
bambara-sts --version

Configuration

|Mode |num_beams |no_repeat_ngram_size| Vitesse | Qualité | |-----------------------------------------------------------------------------------------| |best (défaut) |5 |3 | Standard |Optimale (WER 37.38%)| |fast | 1 |3 | ~3x plus rapide |Légèrement inférieure|

Paramètres par défaut (verrouillés)

{
    "max_new_tokens": 225,
    "num_beams": 5,              # beam search
    "do_sample": False,
    "no_repeat_ngram_size": 3,   # évite répétitions
    "early_stopping": True,
}

Ces paramètres ont été validés sur le test set complet (7,978 échantillons).

  • Formats audio supportés : WAV (recommandé), MP3, FLAC, OGG, M4A.

  • Spécifications recommandées : Sample rate : 16 kHz (auto-resampling si différent) Canaux : Mono (auto-conversion si stéréo) Bit depth : 16-bit ou 32-bit float

  • Cas d'usage:

    • Applications mobiles : Transcription hors-ligne
    • Santé : Transcription de consultations médicales
    • 📰 Médias : Sous-titrage automatique
    • 🎓 Éducation : Transcription de cours
    • 🏛️ Administration : Numérisation d'archives audio
    • 🌍 ONG : Collecte de données terrain au Mali

Developpement

# Cloner le repo
git clone https://github.com/kalilou/whisper-bambara-sts.git
cd whisper-bambara-sts

# Installer en mode développement
pip install -e ".[dev]"

# Lancer les tests
pytest tests/

# Formater le code
black src/whisper_bambara_sts/
ruff check src/whisper_bambara_sts/

📄 Licence:

MIT License - voir le fichier LICENSE pour plus de détails.

Remerciements:

  • OpenAI pour le modèle Whisper
  • La communauté bambara pour les données
  • Hugging Face pour les outils Transformers

Contact

GitHub Issues : https://github.com/kalilou/whisper-bambara-sts/issues

MIT License Copyright (c) 2026 Kalilou Sangaré Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whisper_bambara_sts-1.0.0.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whisper_bambara_sts-1.0.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file whisper_bambara_sts-1.0.0.tar.gz.

File metadata

  • Download URL: whisper_bambara_sts-1.0.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for whisper_bambara_sts-1.0.0.tar.gz
Algorithm Hash digest
SHA256 633623097deef81b3edafc7cf589c9571f5a49e5cc398eab54266a0225c16ee8
MD5 d11baf691631902cf2c00c089547b539
BLAKE2b-256 b4f966f6a31f1e363f477d6948824fa2069d7133f1e0c0400cb41bb2bbdcffa6

See more details on using hashes here.

File details

Details for the file whisper_bambara_sts-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for whisper_bambara_sts-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 faff5b42207f0371f94c677740d908a41e9a0a46c2888f29da81a72daa619613
MD5 3533e794cc17a9d165f25ce3d982a2f5
BLAKE2b-256 f37d6c2c291cb6e40cf48f99b8ad4d1a74b92f7437c9952eb0364b349d2b4728

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page