added description and "how to use" example
Browse files
README.md
CHANGED
|
@@ -27,46 +27,85 @@ model-index:
|
|
| 27 |
type: wer
|
| 28 |
value: 5.408751772230669
|
| 29 |
---
|
|
|
|
| 30 |
|
| 31 |
-
|
| 32 |
-
should probably proofread and complete it, then remove this comment. -->
|
| 33 |
|
| 34 |
-
|
|
|
|
|
|
|
| 35 |
|
| 36 |
-
|
| 37 |
-
It achieves the following results on the evaluation set:
|
| 38 |
-
- Loss: 0.1915
|
| 39 |
-
- Wer: 5.4088
|
| 40 |
|
| 41 |
## Model description
|
| 42 |
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
|
|
|
|
|
|
|
| 48 |
|
| 49 |
## Training and evaluation data
|
| 50 |
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
## Training procedure
|
| 54 |
|
| 55 |
### Training hyperparameters
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
- training_steps: 10000
|
| 66 |
|
| 67 |
-
### Training results
|
| 68 |
|
| 69 |
-
| Training Loss | Epoch | Step | Validation Loss |
|
| 70 |
|:-------------:|:-----:|:-----:|:---------------:|:------:|
|
| 71 |
| 0.0917 | 2.0 | 1000 | 0.1944 | 6.8560 |
|
| 72 |
| 0.0927 | 4.0 | 2000 | 0.1817 | 6.1439 |
|
|
@@ -79,27 +118,57 @@ The following hyperparameters were used during training:
|
|
| 79 |
| 0.1297 | 18.02 | 9000 | 0.1831 | 5.6885 |
|
| 80 |
| 0.0377 | 20.02 | 10000 | 0.1915 | 5.4088 |
|
| 81 |
|
|
|
|
| 82 |
|
| 83 |
-
|
| 84 |
|
| 85 |
-
- Transformers 4.33.0.dev0
|
| 86 |
-
-
|
| 87 |
-
- Datasets 2.14.4
|
| 88 |
-
- Tokenizers 0.13.3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
## Citation
|
| 91 |
|
| 92 |
-
If you use
|
| 93 |
|
| 94 |
```bibtex
|
| 95 |
@misc{dezuazo2025whisperlmimprovingasrmodels,
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
url={https://arxiv.org/abs/2503.23542},
|
| 103 |
}
|
| 104 |
```
|
| 105 |
|
|
@@ -107,9 +176,22 @@ Please, check the related paper preprint in
|
|
| 107 |
[arXiv:2503.23542](https://arxiv.org/abs/2503.23542)
|
| 108 |
for more details.
|
| 109 |
|
| 110 |
-
|
|
|
|
|
|
|
| 111 |
|
| 112 |
This model is available under the
|
| 113 |
[Apache-2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
|
| 114 |
You are free to use, modify, and distribute this model as long as you credit
|
| 115 |
-
the original creators.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
type: wer
|
| 28 |
value: 5.408751772230669
|
| 29 |
---
|
| 30 |
+
# Whisper Medium Spanish
|
| 31 |
|
| 32 |
+
## Model summary
|
|
|
|
| 33 |
|
| 34 |
+
**Whisper Medium Spanish** is an automatic speech recognition (ASR) model for **Spanish (es)**, fine-tuned from [openai/whisper-medium] on the **Spanish subset of Mozilla Common Voice 13.0**. It achieves a **Word Error Rate (WER) of 5.4088%** on the evaluation split.
|
| 35 |
+
|
| 36 |
+
This model offers higher accuracy than Whisper Small while remaining more efficient than Whisper Large variants, making it suitable for both batch and near real-time transcription of Spanish speech.
|
| 37 |
|
| 38 |
+
---
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
## Model description
|
| 41 |
|
| 42 |
+
* **Architecture:** Transformer-based encoder–decoder (Whisper Medium)
|
| 43 |
+
* **Base model:** openai/whisper-medium
|
| 44 |
+
* **Language:** Spanish (es)
|
| 45 |
+
* **Task:** Automatic Speech Recognition (ASR)
|
| 46 |
+
* **Output:** Text transcription in Spanish
|
| 47 |
+
* **Decoding:** Autoregressive sequence-to-sequence decoding
|
| 48 |
+
|
| 49 |
+
Medium-sized model balances accuracy and speed, handling conversational Spanish better than smaller models.
|
| 50 |
+
|
| 51 |
+
---
|
| 52 |
+
|
| 53 |
+
## Intended use
|
| 54 |
+
|
| 55 |
+
### Primary use cases
|
| 56 |
+
|
| 57 |
+
* Batch or streaming transcription of Spanish speech
|
| 58 |
+
* Research on Spanish ASR
|
| 59 |
+
* Applications requiring moderate-to-high transcription accuracy without full-large model compute
|
| 60 |
+
|
| 61 |
+
### Limitations
|
| 62 |
|
| 63 |
+
* Accuracy may drop for:
|
| 64 |
+
* Noisy environments or overlapping speakers
|
| 65 |
+
* Strong regional accents not well represented in Common Voice
|
| 66 |
+
* Extremely fast or slurred speech
|
| 67 |
|
| 68 |
+
* Not intended for legal, medical, or other safety-critical transcription.
|
| 69 |
+
|
| 70 |
+
---
|
| 71 |
|
| 72 |
## Training and evaluation data
|
| 73 |
|
| 74 |
+
* **Dataset:** Mozilla Common Voice 13.0 (Spanish subset)
|
| 75 |
+
* **Data type:** Crowd-sourced read speech
|
| 76 |
+
* **Preprocessing:**
|
| 77 |
+
* Audio resampled to 16 kHz
|
| 78 |
+
* Text tokenized with Whisper tokenizer
|
| 79 |
+
* Removal of invalid or corrupted samples
|
| 80 |
+
|
| 81 |
+
* **Evaluation metric:** Word Error Rate (WER) on held-out evaluation set
|
| 82 |
+
|
| 83 |
+
---
|
| 84 |
+
|
| 85 |
+
## Evaluation results
|
| 86 |
+
|
| 87 |
+
| Metric | Value |
|
| 88 |
+
| ---------- | ---------- |
|
| 89 |
+
| WER (eval) | **5.4088%** |
|
| 90 |
+
|
| 91 |
+
---
|
| 92 |
|
| 93 |
## Training procedure
|
| 94 |
|
| 95 |
### Training hyperparameters
|
| 96 |
|
| 97 |
+
* Learning rate: 1e-5
|
| 98 |
+
* Optimizer: Adam (β1=0.9, β2=0.999, ε=1e-8)
|
| 99 |
+
* LR scheduler: Linear
|
| 100 |
+
* Warmup steps: 500
|
| 101 |
+
* Training steps: 10000
|
| 102 |
+
* Train batch size: 64
|
| 103 |
+
* Eval batch size: 32
|
| 104 |
+
* Seed: 42
|
|
|
|
| 105 |
|
| 106 |
+
### Training results (summary)
|
| 107 |
|
| 108 |
+
| Training Loss | Epoch | Step | Validation Loss | WER |
|
| 109 |
|:-------------:|:-----:|:-----:|:---------------:|:------:|
|
| 110 |
| 0.0917 | 2.0 | 1000 | 0.1944 | 6.8560 |
|
| 111 |
| 0.0927 | 4.0 | 2000 | 0.1817 | 6.1439 |
|
|
|
|
| 118 |
| 0.1297 | 18.02 | 9000 | 0.1831 | 5.6885 |
|
| 119 |
| 0.0377 | 20.02 | 10000 | 0.1915 | 5.4088 |
|
| 120 |
|
| 121 |
+
---
|
| 122 |
|
| 123 |
+
## Framework versions
|
| 124 |
|
| 125 |
+
- Transformers 4.33.0.dev0
|
| 126 |
+
- PyTorch 2.0.1+cu117
|
| 127 |
+
- Datasets 2.14.4
|
| 128 |
+
- Tokenizers 0.13.3
|
| 129 |
+
|
| 130 |
+
---
|
| 131 |
+
|
| 132 |
+
## Example usage
|
| 133 |
+
|
| 134 |
+
```python
|
| 135 |
+
from transformers import pipeline
|
| 136 |
+
|
| 137 |
+
hf_model = "HiTZ/whisper-medium-es" # replace with actual repo ID
|
| 138 |
+
device = 0 # -1 for CPU
|
| 139 |
+
|
| 140 |
+
pipe = pipeline(
|
| 141 |
+
task="automatic-speech-recognition",
|
| 142 |
+
model=hf_model,
|
| 143 |
+
device=device
|
| 144 |
+
)
|
| 145 |
+
|
| 146 |
+
result = pipe("audio.wav")
|
| 147 |
+
print(result["text"])
|
| 148 |
+
```
|
| 149 |
+
|
| 150 |
+
---
|
| 151 |
+
|
| 152 |
+
## Ethical considerations and risks
|
| 153 |
+
|
| 154 |
+
* This model transcribes speech and may process personal data.
|
| 155 |
+
* Users should ensure compliance with applicable data protection laws (e.g., GDPR).
|
| 156 |
+
* The model should not be used for surveillance or non-consensual audio processing.
|
| 157 |
+
|
| 158 |
+
---
|
| 159 |
|
| 160 |
## Citation
|
| 161 |
|
| 162 |
+
If you use this model in your research, please cite:
|
| 163 |
|
| 164 |
```bibtex
|
| 165 |
@misc{dezuazo2025whisperlmimprovingasrmodels,
|
| 166 |
+
title={Whisper-LM: Improving ASR Models with Language Models for Low-Resource Languages},
|
| 167 |
+
author={Xabier de Zuazo and Eva Navas and Ibon Saratxaga and Inma Hernáez Rioja},
|
| 168 |
+
year={2025},
|
| 169 |
+
eprint={2503.23542},
|
| 170 |
+
archivePrefix={arXiv},
|
| 171 |
+
primaryClass={cs.CL}
|
|
|
|
| 172 |
}
|
| 173 |
```
|
| 174 |
|
|
|
|
| 176 |
[arXiv:2503.23542](https://arxiv.org/abs/2503.23542)
|
| 177 |
for more details.
|
| 178 |
|
| 179 |
+
---
|
| 180 |
+
|
| 181 |
+
## License
|
| 182 |
|
| 183 |
This model is available under the
|
| 184 |
[Apache-2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
|
| 185 |
You are free to use, modify, and distribute this model as long as you credit
|
| 186 |
+
the original creators.
|
| 187 |
+
|
| 188 |
+
---
|
| 189 |
+
|
| 190 |
+
## Contact and attribution
|
| 191 |
+
|
| 192 |
+
* Fine-tuning and evaluation: HiTZ/Aholab - Basque Center for Language Technology
|
| 193 |
+
* Base model: OpenAI Whisper
|
| 194 |
+
* Dataset: Mozilla Common Voice
|
| 195 |
+
|
| 196 |
+
For questions or issues, please open an issue in the model repository.
|
| 197 |
+
|