File size: 1,284 Bytes
9a0e59e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# 🗣️ Speech-to-Text Model: Whisper Small (openai/whisper-small)

This repository demonstrates how to fine-tune, evaluate, quantize, and deploy the [OpenAI Whisper Small](https://huggingface.co/openai/whisper-small) model for automatic speech recognition (ASR).

---

## 📦 Model Used

- **Model Name**: `openai/whisper-small`
- **Architecture**: Transformer-based encoder-decoder
- **Task**: Automatic Speech Recognition (ASR)
- **Pretrained by**: OpenAI

---

## 🧾 Dataset

We use the [common_voice](https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0) dataset from Hugging Face.

### 🔹 Load English Subset:

```python
from datasets import load_dataset
dataset = load_dataset("mozilla-foundation/common_voice_13_0", "en", split="train[:1%]")
```

# 🧠 Evaluation / Scoring (WER)
```python

from datasets import load_metric
import numpy as np

wer_metric = load_metric("wer")

def compute_wer(predictions, references):
    return wer_metric.compute(predictions=predictions, references=references)
```

# 🎤 Inference Example
```python

from transformers import pipeline

pipe = pipeline("automatic-speech-recognition", model="./Speech_To_Text_OpenAIWhisper_Model", device=0)

result = pipe("harvard.wav")
print("Transcription:", result["text"])
```