Metadata-Version: 2.4
Name: stt-bench
Version: 0.2.0
Summary: A benchmark tool for Speech-to-Text models.
Author-email: Gautam Jha <gautam@kalpalabs.ai>
License: MIT License
        
        Copyright (c) 2025 Kalpa Labs
        
        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.
        
Requires-Python: ==3.12.3
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: datasets==4.0.0
Requires-Dist: hf-transfer==0.1.9
Requires-Dist: librosa>=0.11.0
Requires-Dist: torch==2.7.0
Requires-Dist: torchaudio==2.7.0
Requires-Dist: torchcodec==0.5.0
Requires-Dist: transformers>=4.52.4
Requires-Dist: jiwer>=4.0.0
Requires-Dist: openai>=2.6.0
Requires-Dist: onnxruntime>=1.23.2
Requires-Dist: typer>=0.20.0
Requires-Dist: deepgram-sdk>=5.2.0
Requires-Dist: indic-nlp-library>=0.92
Requires-Dist: urduhack>=0.1.4
Requires-Dist: pycountry>=24.6.1
Requires-Dist: openai-whisper>=20250625
Requires-Dist: sarvamai>=0.1.21
Requires-Dist: google-genai>=1.46.0
Dynamic: license-file

# stt-bench
cli utility for benchmarking transcription models on Indic Datasets.
Currently supported models:
```
ai4bharat/indic-conformer-600m-multilingual, kalpalabs/Menka, gpt-4o-transcribe, deepgram-nova-3
```

Currently supported datasets:
```
IndicVoices, Lahaja, Svarah, Fleurs
```

## Usage:
1. Environment variables:
Following environment variables need to be set based on the model on which inference is to be performed:
```
HF_TOKEN, OPENAI_API_KEY, MENKA_BASE_URL, DEEPGRAM_API_KEY, SARVAM_API_KEY, GEMINI_API_KEY
```

2. Run inference of a model on multiple datasets - 
```
stt-bench run --model gpt-4o-transcribe
```
This command dumps model inference results into inference/{model}/{dataset} directory for each dataset that the inference is run on. Results are stored in csv named `*predictions.csv`. By default the code will run inference on all supported datasets. To run inference on only selected datasets, use it as:
```
stt-bench run --model gpt-4o-transcribe --eval-datasets Fleurs
```

3. Evaluate WER and CER metrics from the results directory:
```
stt-bench evaluate --dir inference/{model}
```
This will create a `evaluation_metrics.csv` within metrics/{model}/{dataset} that contains wer, cer metrics over all splits of the particular dataset, and the final row contains metrics over the entire dataset.

## Requirements
In addition to pyproject.toml, some datasets (like Lahaja and Svarah) also need ffmpeg backend to process audios. Install ffmpeg >= 6.
