Skip to main content

Modèle ASR Whisper,... pour la transcription audio en Bambara

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.3.tar.gz (13.4 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.3-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: whisper_bambara_sts-1.0.3.tar.gz
  • Upload date:
  • Size: 13.4 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.3.tar.gz
Algorithm Hash digest
SHA256 f7d21993bb1dea25253dd49ec672f06effa9e983f6d54dcc1da05cce9766ca1b
MD5 3d836cc7c65663eb18da9f406346cb74
BLAKE2b-256 63fbe95c08e62c42a20b6c3fa0f5477e5f3ef3db1c0068993472bce26b9f2c87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for whisper_bambara_sts-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c2b96bb1ff5684ca02c4682c9705024daf59bc08563a9c8647bdc09b159dbc57
MD5 6d5509d35c38c15e5a5fec2990a9bd8d
BLAKE2b-256 d589b348e509bc62e332944f997efa87416bcdb5a34a905287834039251d5ee1

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