mohammed's picture
Update README.md
90ffa16 verified
---
language:
- ar
license: apache-2.0
base_model: openai/whisper-large
tags:
- whisper-event
- generated_from_trainer
datasets:
- mozilla-foundation/common_voice_11_0
metrics:
- wer
model-index:
- name: Whisper Small ar - Mohammed Bakheet
results:
- task:
name: Automatic Speech Recognition
type: automatic-speech-recognition
dataset:
name: Common Voice 11.0
type: mozilla-foundation/common_voice_11_0
config: ar
split: test
args: ar
metrics:
- name: Wer
type: wer
value: 12.614980289093298
---
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->
# Whisper Small ar - Mohammed Bakheet
نموذج كلام للتعرف على الصوت، هذا النموذج يتميز بدقة عالية في التعرف على الصوت باللغة العربية.
This model is a fine-tuned version of [openai/whisper-large](https://huggingface.co/openai/whisper-large) on the Common Voice 11.0 dataset.
It achieves the following results on the evaluation set:
- Loss: 0.1921
- Wer: 12.6150
## Model description
This model is a fine-tuned version of openai/whisper-large on the Common Voice 11.0 dataset. It achieves 12.61 WER.
Data augmentation can be implemented to further improve the model performance.
## Intended uses & limitations
```python
from datasets import load_dataset
from transformers import WhisperProcessor, WhisperForConditionalGeneration
from datasets import Audio
# load the dataset
test_dataset = load_dataset("mozilla-foundation/common_voice_11_0", "ar", split="test", use_auth_token=True, trust_remote_code=True)
# get the processor and model from mohammed/whisper-small-arabic-cv-11
processor = WhisperProcessor.from_pretrained("mohammed/whisper-large-arabic-cv-11")
model = WhisperForConditionalGeneration.from_pretrained("mohammed/whisper-large-arabic-cv-11")
model.config.forced_decoder_ids = None
# resample the audio files to 16000
test_dataset = test_dataset.cast_column("audio", Audio(sampling_rate=16000))
# get 10 exmaples of model transcription
for i in range(10):
sample = test_dataset[i]["audio"]
input_features = processor(sample["array"], sampling_rate=sample["sampling_rate"], return_tensors="pt").input_features
predicted_ids = model.generate(input_features)
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=False)
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
print(f"{i} Reference Sentence: {test_dataset[i]['sentence']}")
print(f"{i} Predicted Sentence: {transcription[0]}")
```
```
0 Reference Sentence: زارني في أوائل الشهر بدري
0 Predicted Sentence: زارني في أوائل الشهر بدري
1 Reference Sentence: إبنك بطل.
1 Predicted Sentence: ابنك بطل
2 Reference Sentence: الواعظ الأمرد هذا الذي
2 Predicted Sentence: أواعز الأمرج هذا الذي
3 Reference Sentence: سمح له هذا بالتخصص في البرونز الصغير، الذي يتم إنتاجه بشكل رئيسي ومربح للتصدير.
3 Predicted Sentence: سمح له هذا بالتخصص في البلونز الصغير الذي اعتمد منتاجه بشكل رئيسي وغربح للتصدير
4 Reference Sentence: ألديك قلم ؟
4 Predicted Sentence: ألديك قلم
5 Reference Sentence: يا نديمي قسم بي الى الصهباء
5 Predicted Sentence: يا نديمي قسم بي إلى الصحباء
6 Reference Sentence: إنك تكبر المشكلة.
6 Predicted Sentence: إنك تكبر المشكلة
7 Reference Sentence: يرغب أن يلتقي بك.
7 Predicted Sentence: يرغب أن يلتقي بك
8 Reference Sentence: إنهم لا يعرفون لماذا حتى.
8 Predicted Sentence: إنهم لا يعرفون لماذا حتى
9 Reference Sentence: سيسعدني مساعدتك أي وقت تحب.
9 Predicted Sentence: سيسعدني مساعدتك أي وقت تحب
```
## Training and evaluation data
This model is trained on the Common Voice 11.0 dataset.
## Training procedure
The model is trained on 64 cores CPU, Nvidia A100 GPU with 48 VRAM, and 100GB Disk space. The GPU utilization reached 100%.
Please check the training hyperparameters below.
### Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 1e-05
- train_batch_size: 4
- eval_batch_size: 4
- seed: 42
- gradient_accumulation_steps: 16
- total_train_batch_size: 64
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_steps: 500
- training_steps: 2000
- mixed_precision_training: Native AMP
### Training results
| Training Loss | Epoch | Step | Validation Loss | Wer |
|:-------------:|:------:|:----:|:---------------:|:-------:|
| 0.1952 | 1.6630 | 1000 | 0.1843 | 14.0098 |
| 0.0339 | 3.3261 | 2000 | 0.1921 | 12.6150 |
### Framework versions
- Transformers 4.43.3
- Pytorch 2.2.0
- Datasets 2.20.0
- Tokenizers 0.19.1