Update README.md
Browse files
README.md
CHANGED
@@ -45,6 +45,58 @@ It achieves the following results on the evaluation set:
|
|
45 |
This model is a fine-tuned version of openai/whisper-large on the Common Voice 11.0 dataset. It achieves 12.61 WER.
|
46 |
Data augmentation can be implemented to further improve the model performance.
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
## Training and evaluation data
|
49 |
|
50 |
This model is trained on the Common Voice 11.0 dataset.
|
|
|
45 |
This model is a fine-tuned version of openai/whisper-large on the Common Voice 11.0 dataset. It achieves 12.61 WER.
|
46 |
Data augmentation can be implemented to further improve the model performance.
|
47 |
|
48 |
+
## Intended uses & limitations
|
49 |
+
|
50 |
+
```python
|
51 |
+
from datasets import load_dataset
|
52 |
+
from transformers import WhisperProcessor, WhisperForConditionalGeneration
|
53 |
+
from datasets import Audio
|
54 |
+
|
55 |
+
# load the dataset
|
56 |
+
test_dataset = load_dataset("mozilla-foundation/common_voice_11_0", "ar", split="test", use_auth_token=True, trust_remote_code=True)
|
57 |
+
|
58 |
+
# get the processor and model from mohammed/whisper-small-arabic-cv-11
|
59 |
+
processor = WhisperProcessor.from_pretrained("mohammed/whisper-large-arabic-cv-11")
|
60 |
+
model = WhisperForConditionalGeneration.from_pretrained("mohammed/whisper-large-arabic-cv-11")
|
61 |
+
model.config.forced_decoder_ids = None
|
62 |
+
|
63 |
+
# resample the audio files to 16000
|
64 |
+
test_dataset = test_dataset.cast_column("audio", Audio(sampling_rate=16000))
|
65 |
+
|
66 |
+
# get 10 exmaples of model transcription
|
67 |
+
for i in range(10):
|
68 |
+
sample = test_dataset[i]["audio"]
|
69 |
+
input_features = processor(sample["array"], sampling_rate=sample["sampling_rate"], return_tensors="pt").input_features
|
70 |
+
predicted_ids = model.generate(input_features)
|
71 |
+
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=False)
|
72 |
+
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
|
73 |
+
print(f"{i} Reference Sentence: {test_dataset[i]['sentence']}")
|
74 |
+
print(f"{i} Predicted Sentence: {transcription[0]}")
|
75 |
+
```
|
76 |
+
|
77 |
+
```
|
78 |
+
0 Reference Sentence: زارني في أوائل الشهر بدري
|
79 |
+
0 Predicted Sentence: زارني في أوائل الشهر بدري
|
80 |
+
1 Reference Sentence: إبنك بطل.
|
81 |
+
1 Predicted Sentence: ابنك بطل
|
82 |
+
2 Reference Sentence: الواعظ الأمرد هذا الذي
|
83 |
+
2 Predicted Sentence: أواعز الأمرج هذا الذي
|
84 |
+
3 Reference Sentence: سمح له هذا بالتخصص في البرونز الصغير، الذي يتم إنتاجه بشكل رئيسي ومربح للتصدير.
|
85 |
+
3 Predicted Sentence: سمح له هذا بالتخصص في البلونز الصغير الذي اعتمد منتاجه بشكل رئيسي وغربح للتصدير
|
86 |
+
4 Reference Sentence: ألديك قلم ؟
|
87 |
+
4 Predicted Sentence: ألديك قلم
|
88 |
+
5 Reference Sentence: يا نديمي قسم بي الى الصهباء
|
89 |
+
5 Predicted Sentence: يا نديمي قسم بي إلى الصحباء
|
90 |
+
6 Reference Sentence: إنك تكبر المشكلة.
|
91 |
+
6 Predicted Sentence: إنك تكبر المشكلة
|
92 |
+
7 Reference Sentence: يرغب أن يلتقي بك.
|
93 |
+
7 Predicted Sentence: يرغب أن يلتقي بك
|
94 |
+
8 Reference Sentence: إنهم لا يعرفون لماذا حتى.
|
95 |
+
8 Predicted Sentence: إنهم لا يعرفون لماذا حتى
|
96 |
+
9 Reference Sentence: سيسعدني مساعدتك أي وقت تحب.
|
97 |
+
9 Predicted Sentence: سيسعدني مساعدتك أي وقت تحب
|
98 |
+
```
|
99 |
+
|
100 |
## Training and evaluation data
|
101 |
|
102 |
This model is trained on the Common Voice 11.0 dataset.
|