Improve dataset card: Add description, links, sample usage, and update metadata

#2
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +117 -12
README.md CHANGED
@@ -1,4 +1,16 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
 
2
  dataset_info:
3
  featrues:
4
  - dtype: string
@@ -36,19 +48,112 @@ configs:
36
  split: recitation_7
37
  - path: data/recitation_8/train/*.parquet
38
  split: recitation_8
39
- license: mit
40
- language:
41
- - ar
42
- size_categories:
43
- - 10K<n<100K
44
- task_categories:
45
- - voice-activity-detection
46
  ---
47
 
48
- # Recitation Segmentation Dataset
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
- This dataset is aiming to build a model that aplit the Holy Quran recitations using puase (وقف).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
- ## TODO
53
- * full description
54
- * feature description
 
 
 
1
  ---
2
+ language:
3
+ - ar
4
+ license: mit
5
+ size_categories:
6
+ - 100K<n<1M
7
+ task_categories:
8
+ - automatic-speech-recognition
9
+ tags:
10
+ - quran
11
+ - arabic
12
+ - tajweed
13
+ - speech-segmentation
14
  dataset_info:
15
  featrues:
16
  - dtype: string
 
48
  split: recitation_7
49
  - path: data/recitation_8/train/*.parquet
50
  split: recitation_8
 
 
 
 
 
 
 
51
  ---
52
 
53
+ # Recitation Segmentation Dataset for Holy Quran Pronunciation Error Detection
54
+
55
+ This dataset is used for building models that segment Holy Quran recitations based on pause points (waqf) with high accuracy. The segments are crucial for tasks like Automatic Pronunciation Error Detection and Correction, leveraging the rigorous recitation rules (tajweed) of the Holy Quran.
56
+
57
+ The dataset was presented in the paper [Automatic Pronunciation Error Detection and Correction of the Holy Quran's Learners Using Deep Learning](https://huggingface.co/papers/2509.00094).
58
+
59
+ - **Project Page**: [https://obadx.github.io/prepare-quran-dataset/](https://obadx.github.io/prepare-quran-dataset/)
60
+ - **Code/Model Repository**: [https://github.com/obadx/recitations-segmenter](https://github.com/obadx/recitations-segmenter)
61
+
62
+ This dataset comprises **850+ hours of audio (~300K annotated utterances)** and was generated through a 98% automated pipeline, which includes:
63
+ * Collection of recitations from expert reciters.
64
+ * Segmentation at pause points (waqf) using a fine-tuned wav2vec2-BERT model.
65
+ * Transcription of segments.
66
+ * Transcript verification via the novel Tasmeea algorithm.
67
+
68
+ A novel Quran Phonetic Script (QPS) is employed to encode Tajweed rules, distinguishing it from standard IPA for Modern Standard Arabic. This high-quality annotated data addresses the scarcity of resources for Quranic speech processing and is crucial for developing robust ASR-based approaches for pronunciation error detection and correction.
69
+
70
+ ## Data Structure and Features
71
+
72
+ The dataset is organized to provide audio waveforms along with their segmentation information. Each record typically includes the following features:
73
+
74
+ * `aya_name`: Name of the Ayah (verse).
75
+ * `reciter_name`: Name of the reciter.
76
+ * `recitation_id`: Unique identifier for the recitation.
77
+ * `url`: URL to the original audio source.
78
+ * `audio`: Audio waveform data.
79
+ * `duration`: Duration of the audio segment in seconds.
80
+ * `speech_intervals`: Timestamps (start and end) of detected speech intervals.
81
+ * `is_interval_complete`: Boolean indicating if the interval represents a complete pause (waqf).
82
+
83
+ The dataset is organized into multiple configurations based on different reciters, with data files located in paths like `data/recitation_0/train/*.parquet`.
84
+
85
+ ## Sample Usage
86
+
87
+ You can use the `recitations-segmenter` Python library to process audio files and extract speech intervals.
88
+
89
+ First, install the necessary Python packages, including `recitations-segmenter` and `transformers`. You may also need `ffmpeg` and `libsndfile` for audio processing:
90
+
91
+ ```bash
92
+ conda create -n segment python=3.12
93
+ conda activate segment
94
+ conda install -c conda-forge ffmpeg libsndfile
95
+ pip install recitations-segmenter
96
+ ```
97
+
98
+ Here's an example of how to use the Python API to segment Holy Quran recitations:
99
+
100
+ ```python
101
+ from pathlib import Path
102
+
103
+ from recitations_segmenter import segment_recitations, read_audio, clean_speech_intervals
104
+ from transformers import AutoFeatureExtractor, AutoModelForAudioFrameClassification
105
+ import torch
106
+
107
+ if __name__ == '__main__':
108
+ device = torch.device('cuda')
109
+ dtype = torch.bfloat16
110
+
111
+ processor = AutoFeatureExtractor.from_pretrained(
112
+ "obadx/recitation-segmenter-v2")
113
+ model = AutoModelForAudioFrameClassification.from_pretrained(
114
+ "obadx/recitation-segmenter-v2",
115
+ )
116
+
117
+ model.to(device, dtype=dtype)
118
+
119
+ # Change this to the file pathes of Holy Quran recitations
120
+ # File pathes with the Holy Quran Recitations
121
+ file_pathes = [
122
+ './assets/dussary_002282.mp3',
123
+ './assets/hussary_053001.mp3',
124
+ ]
125
+ waves = [read_audio(p) for p in file_pathes]
126
+
127
+ # Extracting speech inervals in samples according to 16000 Sample rate
128
+ sampled_outputs = segment_recitations(
129
+ waves,
130
+ model,
131
+ processor,
132
+ device=device,
133
+ dtype=dtype,
134
+ batch_size=8,
135
+ )
136
 
137
+ for out, path in zip(sampled_outputs, file_pathes):
138
+ # Clean The speech intervals by:
139
+ # * merging small silence durations
140
+ # * remove small speech durations
141
+ # * add padding to each speech duration
142
+ # Raises:
143
+ # * NoSpeechIntervals: if the wav is complete silence
144
+ # * TooHighMinSpeechDruation: if `min_speech_duration` is too high which
145
+ # resuls for deleting all speech intervals
146
+ clean_out = clean_speech_intervals(
147
+ out.speech_intervals,
148
+ out.is_complete,
149
+ min_silence_duration_ms=30,
150
+ min_speech_duration_ms=30,
151
+ pad_duration_ms=30,
152
+ return_seconds=True,
153
+ )
154
 
155
+ print(f'Speech Intervals of: {Path(path).name}: ')
156
+ print(clean_out.clean_speech_intervals)
157
+ print(f'Is Recitation Complete: {clean_out.is_complete}')
158
+ print('-' * 40)
159
+ ```