Metadata-Version: 2.4
Name: whisper-bambara-sts
Version: 1.0.3
Summary: Modèle ASR Whisper,... pour la transcription audio en Bambara
Author-email: Kalilou Sangaré <kalilou.compte.ia@gmail.com>
Maintainer-email: Kalilou Sangaré <kalilou.compte.ia@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://huggingface.co/kalilouisangare/whisper-small-bambara-sts-v1
Project-URL: Repository, https://github.com/kalilouisangare/whisper-bambara-sts
Project-URL: Documentation, https://github.com/kalilouisangare/whisper-bambara-sts#readme
Keywords: asr,bambara,whisper,speech-recognition,africa,mali,audio,transcription,sts,kis
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=2.0.0
Requires-Dist: torchaudio>=2.0.0
Requires-Dist: transformers>=4.35.0
Requires-Dist: numpy>=1.20.0
Requires-Dist: soundfile>=0.12.0
Requires-Dist: librosa>=0.10.0
Requires-Dist: click>=8.0
Requires-Dist: rich>=13.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Provides-Extra: gradio
Requires-Dist: gradio>=4.0.0; extra == "gradio"
Provides-Extra: all
Requires-Dist: whisper-bambara-sts[dev,gradio]; extra == "all"
Dynamic: license-file

#  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

```bash
pip install whisper-bambara-sts
```

## Options d'installation

```Bash
# 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

```Python
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

```Bash
# 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)
```Python
{
    "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
```Bash
# 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.
