Automatic Speech Recognition
Transformers
PyTorch
TensorFlow
Safetensors
English
speech_to_text
speech
audio
hf-asr-leaderboard
Eval Results (legacy)
Instructions to use facebook/s2t-small-librispeech-asr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/s2t-small-librispeech-asr with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="facebook/s2t-small-librispeech-asr")# Load model directly from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq processor = AutoProcessor.from_pretrained("facebook/s2t-small-librispeech-asr") model = AutoModelForSpeechSeq2Seq.from_pretrained("facebook/s2t-small-librispeech-asr", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
2e3b22f
1
Parent(s): bb4003f
Update README.md
Browse files
README.md
CHANGED
|
@@ -128,12 +128,12 @@ def map_to_pred(batch):
|
|
| 128 |
attention_mask = features.attention_mask.to("cuda")
|
| 129 |
|
| 130 |
gen_tokens = model.generate(input_features=input_features, attention_mask=attention_mask)
|
| 131 |
-
batch["transcription"] = processor.batch_decode(gen_tokens, skip_special_tokens=True)
|
| 132 |
return batch
|
| 133 |
|
| 134 |
result = librispeech_eval.map(map_to_pred, remove_columns=["audio"])
|
| 135 |
|
| 136 |
-
print("WER:", wer(predictions=result["transcription"], references=result["text"]))
|
| 137 |
```
|
| 138 |
|
| 139 |
*Result (WER)*:
|
|
|
|
| 128 |
attention_mask = features.attention_mask.to("cuda")
|
| 129 |
|
| 130 |
gen_tokens = model.generate(input_features=input_features, attention_mask=attention_mask)
|
| 131 |
+
batch["transcription"] = processor.batch_decode(gen_tokens, skip_special_tokens=True)[0]
|
| 132 |
return batch
|
| 133 |
|
| 134 |
result = librispeech_eval.map(map_to_pred, remove_columns=["audio"])
|
| 135 |
|
| 136 |
+
print("WER:", wer.compute(predictions=result["transcription"], references=result["text"]))
|
| 137 |
```
|
| 138 |
|
| 139 |
*Result (WER)*:
|