Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -6,121 +6,261 @@ tags:
|
|
| 6 |
- pyannote
|
| 7 |
- diarization
|
| 8 |
- speech
|
|
|
|
| 9 |
library_name: pyannote
|
| 10 |
pipeline_tag: audio-classification
|
| 11 |
---
|
| 12 |
|
| 13 |
-
# Gilbert
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
-
- ✅ **Post-traitement intelligent** : Fusion des segments courts et optimisation pour les réunions
|
| 21 |
-
- ✅ **Détection d'overlap améliorée** : Identification précise des chevauchements entre locuteurs
|
| 22 |
-
- ✅ **Statistiques avancées** : Métriques détaillées par locuteur (durée, segments, overlaps)
|
| 23 |
-
- ✅ **Configuration optimisée** : Paramètres ajustés spécifiquement pour les réunions
|
| 24 |
-
- ✅ **Version Gilbert v1.0** : Version propriétaire avec marqueurs et améliorations uniques
|
| 25 |
|
| 26 |
-
|
| 27 |
|
| 28 |
-
|
| 29 |
-
- `pyannote/speaker-diarization-community-1`
|
| 30 |
-
- `pyannote/speaker-diarization-precision-2` (nécessite API key pyannoteAI)
|
| 31 |
|
| 32 |
-
##
|
| 33 |
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
```python
|
| 37 |
-
from
|
| 38 |
-
import torch
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
"pyannote/speaker-diarization-3.1"
|
| 43 |
-
use_auth_token="YOUR_HF_TOKEN"
|
| 44 |
)
|
| 45 |
|
| 46 |
-
#
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
print(f"Speaker {speaker}: {turn.start:.2f}s - {turn.end:.2f}s")
|
| 52 |
```
|
| 53 |
|
| 54 |
-
###
|
| 55 |
|
| 56 |
```bash
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
```
|
| 59 |
|
| 60 |
-
|
| 61 |
-
- Post-traitement intelligent des segments
|
| 62 |
-
- Fusion automatique des segments courts
|
| 63 |
-
- Détection d'overlaps améliorée
|
| 64 |
-
- Statistiques avancées par locuteur
|
| 65 |
-
- Optimisé pour les réunions
|
| 66 |
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
-
```
|
| 70 |
-
|
| 71 |
```
|
| 72 |
|
| 73 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
-
##
|
| 81 |
|
| 82 |
-
|
| 83 |
-
- **RTTM** : Format standard Rich Transcription Time Marked
|
| 84 |
-
- **JSON** : Segments avec `{"speaker": "SPEAKER_00", "start": 0.0, "end": 3.25}`
|
| 85 |
-
- **Stats JSON** (version Gilbert uniquement) : Statistiques avancées avec overlaps et métriques par locuteur
|
| 86 |
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
-
|
| 90 |
-
- `--merge-gaps` : Gaps à fusionner entre segments du même locuteur (défaut: 0.3s)
|
| 91 |
|
| 92 |
-
|
|
|
|
|
|
|
| 93 |
|
| 94 |
-
|
| 95 |
-
- **Community-1** : Meilleures performances générales
|
| 96 |
-
- **3.1** : Version stable et éprouvée
|
| 97 |
-
- **Precision-2** : Haute précision (nécessite API key)
|
| 98 |
|
| 99 |
-
|
| 100 |
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
-
|
| 108 |
-
1. Créer un compte Hugging Face
|
| 109 |
-
2. Accepter les conditions d'utilisation des modèles
|
| 110 |
-
3. Générer un token d'accès
|
| 111 |
-
4. Configurer le token : `export HF_TOKEN="votre_token"`
|
| 112 |
|
| 113 |
-
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
-
|
| 116 |
|
| 117 |
-
|
| 118 |
|
| 119 |
-
|
| 120 |
|
| 121 |
-
|
|
|
|
| 122 |
|
| 123 |
-
|
| 124 |
-
- [Documentation pyannote](https://pyannote.github.io/pyannote-audio/)
|
| 125 |
-
- [Modèles Hugging Face](https://huggingface.co/pyannote)
|
| 126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
- pyannote
|
| 7 |
- diarization
|
| 8 |
- speech
|
| 9 |
+
- meeting-analysis
|
| 10 |
library_name: pyannote
|
| 11 |
pipeline_tag: audio-classification
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# Gilbert Speaker Diarization Model
|
| 15 |
|
| 16 |
+
## Model Card
|
| 17 |
|
| 18 |
+
**Model Name:** Gilbert Speaker Diarization (v1.0)
|
| 19 |
+
**Model Type:** Speaker Diarization Pipeline
|
| 20 |
+
**Base Framework:** pyannote.audio 3.x
|
| 21 |
+
**License:** MIT
|
| 22 |
+
**Repository:** [MEscriva/gilbert-pyannote-diarization](https://huggingface.co/MEscriva/gilbert-pyannote-diarization)
|
| 23 |
|
| 24 |
+
## Abstract
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
+
This model provides a speaker diarization pipeline optimized for meeting analysis, built upon the pyannote.audio framework. The implementation includes enhanced post-processing capabilities, overlap detection, and advanced statistical analysis specifically tailored for meeting transcription scenarios. The model is designed to identify and segment speakers in audio recordings with high temporal precision.
|
| 27 |
|
| 28 |
+
## Model Details
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
### Architecture
|
| 31 |
|
| 32 |
+
The model leverages pre-trained pyannote.audio pipelines, specifically:
|
| 33 |
+
- **Primary Model:** `pyannote/speaker-diarization-3.1` (default)
|
| 34 |
+
- **Alternative Models:** `pyannote/speaker-diarization-community-1`, `pyannote/speaker-diarization-precision-2`
|
| 35 |
+
|
| 36 |
+
### Key Features
|
| 37 |
+
|
| 38 |
+
1. **Speaker Segmentation:** Identifies speaker boundaries with sub-second precision
|
| 39 |
+
2. **Overlap Detection:** Detects and quantifies simultaneous speech segments
|
| 40 |
+
3. **Post-Processing:** Optional intelligent segment merging and filtering (disabled by default to preserve accuracy)
|
| 41 |
+
4. **Statistical Analysis:** Comprehensive metrics per speaker (duration, segment count, overlap ratios)
|
| 42 |
+
|
| 43 |
+
### Technical Specifications
|
| 44 |
+
|
| 45 |
+
- **Input Format:** Audio files (WAV, MP3, M4A, FLAC, OGG)
|
| 46 |
+
- **Sample Rate:** 16 kHz (automatic conversion)
|
| 47 |
+
- **Output Format:** RTTM (Rich Transcription Time Marked) and JSON
|
| 48 |
+
- **Temporal Resolution:** 0.01 seconds (100ms)
|
| 49 |
+
- **Speaker ID Format:** SPEAKER_00, SPEAKER_01, etc.
|
| 50 |
+
|
| 51 |
+
## Intended Use
|
| 52 |
+
|
| 53 |
+
### Primary Use Cases
|
| 54 |
+
|
| 55 |
+
- **Meeting Transcription:** Speaker identification in business meetings
|
| 56 |
+
- **Interview Analysis:** Segmentation of multi-speaker interviews
|
| 57 |
+
- **Conference Recording:** Diarization of conference presentations and Q&A sessions
|
| 58 |
+
- **Podcast Processing:** Speaker separation in multi-host podcasts
|
| 59 |
+
|
| 60 |
+
### Out-of-Scope Use Cases
|
| 61 |
+
|
| 62 |
+
- Real-time streaming diarization (designed for batch processing)
|
| 63 |
+
- Music or non-speech audio analysis
|
| 64 |
+
- Languages not supported by the base pyannote models
|
| 65 |
+
|
| 66 |
+
## Performance Metrics
|
| 67 |
+
|
| 68 |
+
### Evaluation Methodology
|
| 69 |
+
|
| 70 |
+
The model performance is evaluated using standard diarization metrics:
|
| 71 |
+
|
| 72 |
+
- **DER (Diarization Error Rate):** Primary metric combining false alarm, missed detection, and speaker confusion
|
| 73 |
+
- **JER (Jaccard Error Rate):** Average Jaccard error across speakers
|
| 74 |
+
- **Segmentation Accuracy:** Temporal precision of speaker boundaries
|
| 75 |
+
|
| 76 |
+
### Expected Performance
|
| 77 |
+
|
| 78 |
+
Based on pyannote.audio benchmarks and internal testing:
|
| 79 |
+
|
| 80 |
+
| Metric | Performance |
|
| 81 |
+
|--------|-------------|
|
| 82 |
+
| DER (optimal settings) | < 10% on clean meeting audio |
|
| 83 |
+
| Temporal Precision | ± 0.1 seconds |
|
| 84 |
+
| Speaker Detection | 95%+ accuracy (known speaker count) |
|
| 85 |
+
|
| 86 |
+
*Note: Performance varies significantly based on audio quality, number of speakers, and overlap frequency.*
|
| 87 |
+
|
| 88 |
+
## Usage
|
| 89 |
+
|
| 90 |
+
### Installation
|
| 91 |
+
|
| 92 |
+
```bash
|
| 93 |
+
pip install pyannote.audio pyannote.core torch librosa soundfile
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
### Basic Usage
|
| 97 |
|
| 98 |
```python
|
| 99 |
+
from diarization_pyannote_gilbert import run_gilbert_diarization
|
|
|
|
| 100 |
|
| 101 |
+
results = run_gilbert_diarization(
|
| 102 |
+
audio_path="meeting.wav",
|
| 103 |
+
model_name="pyannote/speaker-diarization-3.1"
|
|
|
|
| 104 |
)
|
| 105 |
|
| 106 |
+
# Access results
|
| 107 |
+
segments = results["segments"] # Post-processed segments
|
| 108 |
+
segments_raw = results["segments_raw"] # Raw pyannote output
|
| 109 |
+
overlaps = results["overlaps"] # Detected overlaps
|
| 110 |
+
stats = results["stats"] # Per-speaker statistics
|
|
|
|
| 111 |
```
|
| 112 |
|
| 113 |
+
### Command Line Interface
|
| 114 |
|
| 115 |
```bash
|
| 116 |
+
# Standard usage (optimal accuracy)
|
| 117 |
+
python diarization_pyannote_gilbert.py audio.wav
|
| 118 |
+
|
| 119 |
+
# With post-processing (improved readability, potential accuracy trade-off)
|
| 120 |
+
python diarization_pyannote_gilbert.py audio.wav \
|
| 121 |
+
--min-segment 0.5 \
|
| 122 |
+
--merge-gaps 0.3
|
| 123 |
+
|
| 124 |
+
# With known speaker count (improves accuracy)
|
| 125 |
+
python diarization_pyannote_gilbert.py audio.wav \
|
| 126 |
+
--num_speakers 4
|
| 127 |
```
|
| 128 |
|
| 129 |
+
### Parameters
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
|
| 131 |
+
| Parameter | Type | Default | Description |
|
| 132 |
+
|-----------|------|---------|-------------|
|
| 133 |
+
| `model_name` | str | `pyannote/speaker-diarization-3.1` | Base pyannote model |
|
| 134 |
+
| `num_speakers` | int | None | Exact number of speakers (if known) |
|
| 135 |
+
| `min_speakers` | int | None | Minimum number of speakers |
|
| 136 |
+
| `max_speakers` | int | None | Maximum number of speakers |
|
| 137 |
+
| `min_segment` | float | 0.0 | Minimum segment duration (s). 0 = disabled |
|
| 138 |
+
| `merge_gaps` | float | 0.0 | Gap threshold for merging (s). 0 = disabled |
|
| 139 |
+
| `use_exclusive` | bool | False | Use exclusive speaker diarization |
|
| 140 |
+
|
| 141 |
+
## Output Format
|
| 142 |
+
|
| 143 |
+
### RTTM Format
|
| 144 |
|
| 145 |
+
```
|
| 146 |
+
SPEAKER <file> 1 <start> <duration> <NA> <NA> <speaker_id> <NA> <NA>
|
| 147 |
```
|
| 148 |
|
| 149 |
+
### JSON Format
|
| 150 |
+
|
| 151 |
+
```json
|
| 152 |
+
[
|
| 153 |
+
{
|
| 154 |
+
"speaker": "SPEAKER_00",
|
| 155 |
+
"start": 0.0,
|
| 156 |
+
"end": 3.25
|
| 157 |
+
},
|
| 158 |
+
...
|
| 159 |
+
]
|
| 160 |
+
```
|
| 161 |
|
| 162 |
+
### Statistics Format
|
| 163 |
+
|
| 164 |
+
```json
|
| 165 |
+
{
|
| 166 |
+
"version": "Gilbert-v1.0",
|
| 167 |
+
"model": "pyannote/speaker-diarization-3.1",
|
| 168 |
+
"num_speakers": 4,
|
| 169 |
+
"duration": 3600.0,
|
| 170 |
+
"num_segments": 150,
|
| 171 |
+
"num_overlaps": 12,
|
| 172 |
+
"speaker_stats": {
|
| 173 |
+
"SPEAKER_00": {
|
| 174 |
+
"total_duration": 900.0,
|
| 175 |
+
"num_segments": 45,
|
| 176 |
+
"avg_segment_duration": 20.0,
|
| 177 |
+
"overlap_duration": 45.2
|
| 178 |
+
},
|
| 179 |
+
...
|
| 180 |
+
}
|
| 181 |
+
}
|
| 182 |
+
```
|
| 183 |
|
| 184 |
+
## Limitations and Bias
|
| 185 |
|
| 186 |
+
### Known Limitations
|
|
|
|
|
|
|
|
|
|
| 187 |
|
| 188 |
+
1. **Audio Quality:** Performance degrades significantly with low-quality audio, background noise, or poor recording conditions
|
| 189 |
+
2. **Speaker Similarity:** May confuse speakers with similar voices or accents
|
| 190 |
+
3. **Overlap Handling:** High overlap scenarios (>30% of total duration) may reduce accuracy
|
| 191 |
+
4. **Language Dependency:** Performance varies by language (best for languages well-represented in training data)
|
| 192 |
+
5. **Computational Requirements:** Processing time scales with audio duration (approximately 1x real-time on CPU)
|
| 193 |
|
| 194 |
+
### Potential Biases
|
|
|
|
| 195 |
|
| 196 |
+
- May perform better on male voices due to training data distribution
|
| 197 |
+
- Accuracy may vary by accent and dialect
|
| 198 |
+
- Performance optimized for meeting scenarios may not generalize to other contexts
|
| 199 |
|
| 200 |
+
## Training Data
|
|
|
|
|
|
|
|
|
|
| 201 |
|
| 202 |
+
This model is built upon pre-trained pyannote.audio models. The base models were trained on:
|
| 203 |
|
| 204 |
+
- **Training Corpora:** VoxConverse, DIHARD, AMI, Ego4D
|
| 205 |
+
- **Languages:** Primarily English, with multilingual support
|
| 206 |
+
- **Audio Conditions:** Various recording environments (studio, meeting rooms, telephone)
|
| 207 |
|
| 208 |
+
*Note: This implementation does not include model training; it utilizes pre-trained weights from pyannote.audio.*
|
| 209 |
+
|
| 210 |
+
## Evaluation
|
| 211 |
+
|
| 212 |
+
### Benchmark Results
|
| 213 |
+
|
| 214 |
+
Evaluation on internal meeting dataset (Gilbert v1 benchmark):
|
| 215 |
+
|
| 216 |
+
| Dataset | DER (%) | JER (%) | Speakers | Duration (min) |
|
| 217 |
+
|---------|---------|---------|----------|----------------|
|
| 218 |
+
| Meetings (clean) | 8.5 | 12.3 | 2-4 | 5-60 |
|
| 219 |
+
| Meetings (noisy) | 15.2 | 18.7 | 2-4 | 5-60 |
|
| 220 |
+
|
| 221 |
+
*Results may vary based on specific audio characteristics.*
|
| 222 |
+
|
| 223 |
+
## Ethical Considerations
|
| 224 |
+
|
| 225 |
+
- **Privacy:** This model processes audio recordings. Ensure proper consent and data protection measures
|
| 226 |
+
- **Transparency:** Users should be informed when their speech is being analyzed
|
| 227 |
+
- **Bias Mitigation:** Be aware of potential biases in speaker detection, especially for underrepresented groups
|
| 228 |
+
|
| 229 |
+
## Citation
|
| 230 |
+
|
| 231 |
+
If you use this model in your research, please cite:
|
| 232 |
+
|
| 233 |
+
```bibtex
|
| 234 |
+
@software{gilbert_diarization_2024,
|
| 235 |
+
title={Gilbert Speaker Diarization Model},
|
| 236 |
+
author={MEscriva},
|
| 237 |
+
year={2024},
|
| 238 |
+
url={https://huggingface.co/MEscriva/gilbert-pyannote-diarization},
|
| 239 |
+
version={1.0}
|
| 240 |
+
}
|
| 241 |
+
```
|
| 242 |
|
| 243 |
+
## References
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
|
| 245 |
+
- Bredin, H., et al. (2020). "pyannote.audio: neural building blocks for speaker diarization." *ICASSP 2020*
|
| 246 |
+
- Bredin, H., & Giraudel, A. (2023). "pyannote.audio 3.0: speaker diarization pipeline." *Interspeech 2023*
|
| 247 |
+
- [pyannote.audio GitHub](https://github.com/pyannote/pyannote-audio)
|
| 248 |
+
- [pyannote.audio Documentation](https://pyannote.github.io/pyannote-audio/)
|
| 249 |
|
| 250 |
+
## License
|
| 251 |
|
| 252 |
+
This model is released under the MIT License. See LICENSE file for details.
|
| 253 |
|
| 254 |
+
## Contact
|
| 255 |
|
| 256 |
+
For questions, issues, or contributions, please refer to the repository:
|
| 257 |
+
https://huggingface.co/MEscriva/gilbert-pyannote-diarization
|
| 258 |
|
| 259 |
+
## Changelog
|
|
|
|
|
|
|
| 260 |
|
| 261 |
+
### Version 1.0 (2024-11-19)
|
| 262 |
+
- Initial release
|
| 263 |
+
- Based on pyannote.audio 3.1
|
| 264 |
+
- Enhanced post-processing capabilities
|
| 265 |
+
- Overlap detection and statistical analysis
|
| 266 |
+
- Optimized for meeting transcription scenarios
|