nicolasRossard/stt

0

stars

0

commits

Python

primary language

Feb 15, 2026

updated

README

Kyutai STT - Transcription Française en Direct

Application web Streamlit pour la transcription vocale française en temps réel avec correction automatique du texte.

Fonctionnalités

  • Transcription en temps réel via microphone (WebRTC)
  • Correction automatique du texte transcrit (orthographe, grammaire)
  • Suppression des hésitations (euh, hum, etc.)
  • Export TXT et copie rapide
  • Interface simple une seule page

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    Streamlit Frontend                        │
│  ┌─────────────┐  ┌──────────────┐  ┌────────────────────┐  │
│  │ Audio Input │  │ Transcription│  │ Text Correction    │  │
│  │ (WebRTC)    │──│ Display      │──│ (LanguageTool)     │  │
│  └─────────────┘  └──────────────┘  └────────────────────┘  │
│         │                │                    │              │
│         ▼                ▼                    ▼              │
│  ┌─────────────────────────────────────────────────────────┐│
│  │              Kyutai STT (Streaming, CPU)                ││
│  │              ~1-2s latency on CPU, FR optimized         ││
│  └─────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────┘

Installation

Prérequis

  • Python 3.13+
  • uv (gestionnaire de paquets)

Dépendances

# Dépendances de base
uv add streamlit streamlit-webrtc scipy pydantic

# Transformers et Torch pour Kyutai STT
uv add transformers torch

# Pour la correction de texte (optionnel)
uv add language-tool-python

Installation rapide

# Cloner le projet
git clone <repository-url>
cd kyutai-stt

# Installer toutes les dépendances
make install

# Ou manuellement
uv sync --group dev

Utilisation

Lancer l'application

make run
# ou
uv run streamlit run src/kyutai_stt/app.py

Workflow

  1. Ouvrir l'application dans le navigateur (http://localhost:8501)
  2. Cliquer sur Démarrer pour activer le microphone
  3. Parler en français
  4. Voir la transcription en temps réel
  5. Le texte corrigé apparaît automatiquement
  6. Utiliser les boutons Copier ou Exporter TXT

Structure du projet

kyutai-stt/
├── pyproject.toml
├── Makefile
├── README.md
├── documentation/
│   ├── plans/
│   └── TASKS.md
├── src/
│   └── kyutai_stt/
│       ├── __init__.py
│       ├── app.py              # Application Streamlit principale
│       ├── audio/
│       │   ├── __init__.py
│       │   └── capture.py      # Capture audio WebRTC
│       ├── transcription/
│       │   ├── __init__.py
│       │   └── kyutai_client.py # Client Kyutai STT
│       └── correction/
│           ├── __init__.py
│           └── text_corrector.py # Correction de texte FR
└── tests/
    └── __init__.py

Modules

Audio Capture (audio/capture.py)

  • Capture audio via WebRTC depuis le navigateur
  • Conversion en format compatible Kyutai (24kHz, mono, float32)
  • Buffering et segmentation des chunks audio

Transcription (transcription/kyutai_client.py)

  • Client pour Kyutai STT via Hugging Face transformers
  • Modèles disponibles: kyutai/stt-1b-en_fr (FR+EN, 1B params) ou kyutai/stt-2.6b-en_fr-trfs (FR+EN, 2.6B params)
  • Streaming de transcription en temps réel
  • Optimisation CPU/GPU automatique

Correction (correction/text_corrector.py)

  • Suppression des hésitations françaises
  • Correction orthographique (LanguageTool)
  • Correction grammaticale
  • Nettoyage de la ponctuation

Commandes Make

CommandeDescription
make installInstaller les dépendances
make runLancer l'application Streamlit
make lintVérifier le code avec ruff
make formatFormater le code avec ruff
make testLancer les tests
make cleanNettoyer les fichiers cache

Configuration

Variables d'environnement

VariableDescriptionDéfaut
KYUTAI_MODELRéférence du modèle HuggingFacekyutai/stt-1b-en_fr
KYUTAI_DEVICEDevice d'inférence (cpu/cuda)cpu

Paramètres audio

ParamètreValeur
Taux d'échantillonnage24000 Hz
Canaux1 (mono)
Durée chunk500 ms

Limitations connues

  • Latence CPU : 1-2 secondes de délai sur CPU
  • LanguageTool : Nécessite Java pour fonctionner localement

Troubleshooting

Le modèle ne charge pas

# Vérifier que transformers est installé
python -c "from transformers import KyutaiSpeechToTextProcessor; print('OK')"

# Le modèle se télécharge automatiquement depuis Hugging Face au premier lancement
# Modèle utilisé: kyutai/stt-1b-en_fr (1B paramètres, français + anglais)

Pas de son capturé

  • Vérifier les permissions du navigateur pour le microphone
  • Utiliser HTTPS en production (requis pour WebRTC)

LanguageTool ne fonctionne pas

# Installer Java
sudo apt install default-jre  # Ubuntu/Debian

# Vérifier LanguageTool
python -c "import language_tool_python; print('OK')"

Licence

MIT

Auteurs

  • Développé avec Claude Code

nicolasRossard/stt

0

stars

0

commits

Python

primary language

Feb 15, 2026

updated

README

Kyutai STT - Transcription Française en Direct

Application web Streamlit pour la transcription vocale française en temps réel avec correction automatique du texte.

Fonctionnalités

  • Transcription en temps réel via microphone (WebRTC)
  • Correction automatique du texte transcrit (orthographe, grammaire)
  • Suppression des hésitations (euh, hum, etc.)
  • Export TXT et copie rapide
  • Interface simple une seule page

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    Streamlit Frontend                        │
│  ┌─────────────┐  ┌──────────────┐  ┌────────────────────┐  │
│  │ Audio Input │  │ Transcription│  │ Text Correction    │  │
│  │ (WebRTC)    │──│ Display      │──│ (LanguageTool)     │  │
│  └─────────────┘  └──────────────┘  └────────────────────┘  │
│         │                │                    │              │
│         ▼                ▼                    ▼              │
│  ┌─────────────────────────────────────────────────────────┐│
│  │              Kyutai STT (Streaming, CPU)                ││
│  │              ~1-2s latency on CPU, FR optimized         ││
│  └─────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────┘

Installation

Prérequis

  • Python 3.13+
  • uv (gestionnaire de paquets)

Dépendances

# Dépendances de base
uv add streamlit streamlit-webrtc scipy pydantic

# Transformers et Torch pour Kyutai STT
uv add transformers torch

# Pour la correction de texte (optionnel)
uv add language-tool-python

Installation rapide

# Cloner le projet
git clone <repository-url>
cd kyutai-stt

# Installer toutes les dépendances
make install

# Ou manuellement
uv sync --group dev

Utilisation

Lancer l'application

make run
# ou
uv run streamlit run src/kyutai_stt/app.py

Workflow

  1. Ouvrir l'application dans le navigateur (http://localhost:8501)
  2. Cliquer sur Démarrer pour activer le microphone
  3. Parler en français
  4. Voir la transcription en temps réel
  5. Le texte corrigé apparaît automatiquement
  6. Utiliser les boutons Copier ou Exporter TXT

Structure du projet

kyutai-stt/
├── pyproject.toml
├── Makefile
├── README.md
├── documentation/
│   ├── plans/
│   └── TASKS.md
├── src/
│   └── kyutai_stt/
│       ├── __init__.py
│       ├── app.py              # Application Streamlit principale
│       ├── audio/
│       │   ├── __init__.py
│       │   └── capture.py      # Capture audio WebRTC
│       ├── transcription/
│       │   ├── __init__.py
│       │   └── kyutai_client.py # Client Kyutai STT
│       └── correction/
│           ├── __init__.py
│           └── text_corrector.py # Correction de texte FR
└── tests/
    └── __init__.py

Modules

Audio Capture (audio/capture.py)

  • Capture audio via WebRTC depuis le navigateur
  • Conversion en format compatible Kyutai (24kHz, mono, float32)
  • Buffering et segmentation des chunks audio

Transcription (transcription/kyutai_client.py)

  • Client pour Kyutai STT via Hugging Face transformers
  • Modèles disponibles: kyutai/stt-1b-en_fr (FR+EN, 1B params) ou kyutai/stt-2.6b-en_fr-trfs (FR+EN, 2.6B params)
  • Streaming de transcription en temps réel
  • Optimisation CPU/GPU automatique

Correction (correction/text_corrector.py)

  • Suppression des hésitations françaises
  • Correction orthographique (LanguageTool)
  • Correction grammaticale
  • Nettoyage de la ponctuation

Commandes Make

CommandeDescription
make installInstaller les dépendances
make runLancer l'application Streamlit
make lintVérifier le code avec ruff
make formatFormater le code avec ruff
make testLancer les tests
make cleanNettoyer les fichiers cache

Configuration

Variables d'environnement

VariableDescriptionDéfaut
KYUTAI_MODELRéférence du modèle HuggingFacekyutai/stt-1b-en_fr
KYUTAI_DEVICEDevice d'inférence (cpu/cuda)cpu

Paramètres audio

ParamètreValeur
Taux d'échantillonnage24000 Hz
Canaux1 (mono)
Durée chunk500 ms

Limitations connues

  • Latence CPU : 1-2 secondes de délai sur CPU
  • LanguageTool : Nécessite Java pour fonctionner localement

Troubleshooting

Le modèle ne charge pas

# Vérifier que transformers est installé
python -c "from transformers import KyutaiSpeechToTextProcessor; print('OK')"

# Le modèle se télécharge automatiquement depuis Hugging Face au premier lancement
# Modèle utilisé: kyutai/stt-1b-en_fr (1B paramètres, français + anglais)

Pas de son capturé

  • Vérifier les permissions du navigateur pour le microphone
  • Utiliser HTTPS en production (requis pour WebRTC)

LanguageTool ne fonctionne pas

# Installer Java
sudo apt install default-jre  # Ubuntu/Debian

# Vérifier LanguageTool
python -c "import language_tool_python; print('OK')"

Licence

MIT

Auteurs

  • Développé avec Claude Code

Languages

Python

98.3%

Makefile

1.7%