Downloads · 30 days
57
7% of all-time downloads
yousifgamalo/quran-s-finetuned
quran-s-finetuned is a automatic speech recognition model from yousifgamalo. Use it when you need speech turned into text. The card lists the license as apache-2.0.
This model is a fine-tuned version of openai/whisper-medium specifically optimized for Arabic Quran recitation transcription.
Downloads · 30 days
57
7% of all-time downloads
All-time downloads
831
Public
Parameters
764M
1.9 TB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors3.1 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of openai/whisper-medium specifically optimized for Arabic Quran recitation transcription.
The model was fine-tuned using Full Fine-tuning on a dataset of professional and non professional Quran recitations from MP3Quran and tarteel AI, making it highly effective for transcribing Quranic Arabic speech.
The dataset consists of Quran recitations by professional reciters from MP3Quran, preprocessed with:
Training Arguments:
Generation Configuration:
| Metric | Value |
|---|---|
| Word Error Rate (WER) | 0.1162 |
| Test Loss | 0.0317 |
| Runtime (seconds) | 1300.45 |
| Samples per second | 9.81 |
The model was evaluated on a held-out test set of 12761 samples from the same distribution as the training data (professional Quran recitations from MP3Quran).
pip install transformers torch torchaudio
import torch
from transformers import WhisperProcessor, WhisperForConditionalGeneration
from datasets import load_dataset, Audio
# Load model and processor
model_id = "yousifgamalo/quran-s-finetuned"
processor = WhisperProcessor.from_pretrained(model_id)
model = WhisperForConditionalGeneration.from_pretrained(model_id)
# Move to GPU if available
device = "cuda" if torch.cuda.is_available() else "cpu"
model.to(device)
# Load and preprocess audio
# Example: Load from a file
import librosa
audio_array, sampling_rate = librosa.load("quran_recitation.wav", sr=16000)
# Process audio
input_features = processor(
audio_array,
sampling_rate=16000,
return_tensors="pt"
).input_features.to(device)
# Generate transcription
# The model is configured to output Arabic text automatically
predicted_ids = model.generate(input_features)
# Decode prediction
transcription = processor.batch_decode(
predicted_ids,
skip_special_tokens=True
)[0]
print(f"Transcription: {transcription}")
from transformers import pipeline
# Create ASR pipeline
pipe = pipeline(
"automatic-speech-recognition",
model="yousifgamalo/quran-s-finetuned",
device=0 if torch.cuda.is_available() else -1
)
# Transcribe audio
result = pipe("quran_recitation.wav")
print(result["text"])
This model was trained using full fine-tuning, where all model parameters are updated during training. This provides maximum flexibility but requires more memory and compute resources.
If you use this model, please cite:
author = {Yousif H A },
title = {Whisper Medium - Quran Fine-tuned },
year = {2024},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/yousifgamalo/quran-s-finetuned}}
}
Also cite the original Whisper paper:
@article{radford2022whisper,
title={Robust Speech Recognition via Large-Scale Weak Supervision},
author={Radford, Alec and Kim, Jong Wook and Xu, Tao and Brockman, Greg and McLeavey, Christine and Sutskever, Ilya},
journal={arXiv preprint arXiv:2212.04356},
year={2022}
}
For questions or issues, please open an issue in the model repository.