NightPrince commited on
Commit
50f380f
ยท
verified ยท
1 Parent(s): e724d4d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +302 -278
README.md CHANGED
@@ -1,278 +1,302 @@
1
- ---
2
- dataset_info:
3
- features:
4
- - name: audio
5
- dtype: audio
6
- - name: transcription
7
- dtype: string
8
- splits:
9
- - name: train
10
- num_bytes: 1110063079
11
- num_examples: 5000
12
- - name: validation
13
- num_bytes: 82102316
14
- num_examples: 500
15
- download_size: 1138402984
16
- dataset_size: 1192165395
17
- configs:
18
- - config_name: default
19
- data_files:
20
- - split: train
21
- path: data/train-*
22
- - split: validation
23
- path: data/validation-*
24
- tags:
25
- - masrispeech
26
- - egyptian-arabic
27
- - arabic
28
- - speech
29
- - audio
30
- - asr
31
- - automatic-speech-recognition
32
- - speech-to-text
33
- - stt
34
- - dialectal-arabic
35
- - egypt
36
- - native-speakers
37
- - spoken-arabic
38
- - egyptian-dialect
39
- - arabic-dialect
40
- - audio-dataset
41
- - language-resources
42
- - low-resource-language
43
- - phonetics
44
- - speech-corpus
45
- - voice
46
- - transcription
47
- - linguistic-data
48
- - machine-learning
49
- - natural-language-processing
50
- - nlp
51
- - huggingface
52
- - open-dataset
53
- - labeled-data
54
- task_categories:
55
- - automatic-speech-recognition
56
- - audio-classification
57
- - audio-to-audio
58
- language:
59
- - arz
60
- - ar
61
- pretty_name: MasriSpeech-ASR-Finetuning
62
- ---
63
-
64
-
65
- # ๐Ÿ—ฃ๏ธ MasriSpeech-ASR-Finetuning: Egyptian Arabic Speech Fine-Tuning Dataset
66
-
67
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
68
- [![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Dataset-blue)](https://huggingface.co/collections/NightPrince/masrispeech-dataset-68594e59e46fd12c723f1544)
69
-
70
- <p align="center">
71
- <img src="https://photos.fife.usercontent.google.com/pw/AP1GczMrHAd6vsWiDzHtrWwBu_GzNBEpHvGZpDcnahMOt5npvlI-fdt65fuuig=w618-h927-s-no-gm?authuser=0" alt="MasriSpeech-ASR-Finetuning Dataset Overview" width="650">
72
- </p>
73
-
74
- ## ๐ŸŒ Overview
75
- **MasriSpeech-ASR-Finetuning** is a specialized subset of the MasriSpeech dataset, designed for fine-tuning Automatic Speech Recognition (ASR) models for Egyptian Arabic. This dataset contains 5,500 professionally annotated audio samples totaling over 100 hours of natural Egyptian Arabic speech.
76
-
77
- > ๐Ÿ’ก **Key Features**:
78
- > - High-quality 16kHz speech recordings
79
- > - Natural conversational Egyptian Arabic
80
- > - Speaker-balanced train/validation splits
81
- > - Comprehensive linguistic coverage
82
- > - Apache 2.0 license
83
-
84
- ## ๐Ÿ“Š Dataset Summary
85
-
86
- | Feature | Value |
87
- |--------------------------|---------------------------|
88
- | **Total Samples** | 5,500 |
89
- | **Train Samples** | 5,000 |
90
- | **Validation Samples** | 500 |
91
- | **Sampling Rate** | 16 kHz |
92
- | **Total Duration** | ~100 hours |
93
- | **Languages** | Egyptian Arabic (arz), Arabic (ar) |
94
- | **Format** | Parquet |
95
- | **Dataset Size** | 1.19 GB |
96
- | **Download Size** | 1.13 GB |
97
- | **Annotations** | Transcripts |
98
-
99
- ## ๐Ÿงฑ Dataset Structure
100
- The dataset follows Hugging Face `datasets` format with two splits:
101
-
102
- ```python
103
- DatasetDict({
104
- train: Dataset({
105
- features: ['audio', 'transcription'],
106
- num_rows: 5000
107
- })
108
- validation: Dataset({
109
- features: ['audio', 'transcription'],
110
- num_rows: 500
111
- })
112
- })
113
-
114
- ## Data Fields
115
-
116
- - **audio**: Audio feature object containing:
117
- - `Array`: Raw speech waveform (1D float array)
118
- - `Path`: Relative audio path
119
- - `Sampling_rate`: 16,000 Hz
120
- - **transcription**: string with Egyptian Arabic transcription
121
-
122
- ## ๐Ÿ“ˆ Data Statistics
123
-
124
- ### Split Distribution
125
-
126
- | Split | Examples | Size (GB) | Avg. Words | Empty | Non-Arabic |
127
- |--------------|----------|-----------|------------|-------|------------|
128
- | **Train** | 5,000 | 1.11 | 13.34 | 0 | 0 |
129
- | **Validation**| 500 | 0.08 | 9.60 | 0 | 0 |
130
-
131
- ### Linguistic Analysis
132
-
133
- | Feature | Train Set | Validation Set |
134
- |-----------------|---------------------------|----------------------------|
135
- | **Top Words** | ููŠ (2,025), ูˆ (1,698) | ููŠ (52), ุฃู†ุง (41) |
136
- | **Top Bigrams** | (ุฅู†, ุฃู†ุง) (130) | (ุดุงุก, ุงู„ู„ู‡) (6) |
137
- | **Vocab Size** | 3,845 | 789 |
138
- | **Unique Speakers** | 114 | 10 |
139
-
140
- <p align="center">
141
- <img src="https://photos.fife.usercontent.google.com/pw/AP1GczNy2HLdi9J2wLQt_m-9Wu713_9uX2k3FsIytd6NxS7C_bAYkPqisRLOLg=w800-h400-s-no-gm?authuser=0" alt="Train Distribution" width="45%">
142
- <img src="https://photos.fife.usercontent.google.com/pw/AP1GczNPSXQnWjDc7LElNeCff8wmP6-nT59WmTiPREKDhlD6RrUHX8TIC6ocbw=w800-h400-s-no-gm?authuser=0" alt="Validation Distribution" width="45%">
143
- <br><em>Word Count Distributions (Left: Train, Right: Validation)</em>
144
- </p>
145
-
146
-
147
- ## How to Use ? ๐Ÿง‘โ€๐Ÿ’ป
148
-
149
- ### Loading with Hugging Face
150
- ```python
151
- from datasets import load_dataset
152
- import IPython.display as ipd
153
-
154
- # Load dataset (streaming recommended for large datasets)
155
- ds = load_dataset('NightPrince/MasriSpeech-ASR-Finetuning',
156
- split='train',
157
- streaming=True)
158
-
159
- # Get first sample
160
- sample = next(iter(ds))
161
- print(f"Transcript: {sample['transcription']}")
162
-
163
- # Play audio
164
- ipd.Audio(sample['audio']['array'],
165
- rate=sample['audio']['sampling_rate'])
166
- ```
167
-
168
- ### Preprocessing the Dataset
169
- ```python
170
- from transformers import AutoProcessor
171
-
172
- # Load pre-trained processor
173
- processor = AutoProcessor.from_pretrained("facebook/wav2vec2-large-xlsr-53")
174
-
175
- # Preprocessing function
176
- def prepare_dataset(batch):
177
- audio = batch["audio"]
178
- # Process audio
179
- batch["input_values"] = processor(audio["array"],
180
- sampling_rate=audio["sampling_rate"],
181
- return_tensors="pt").input_values[0]
182
- # Process transcription
183
- batch["labels"] = processor(text=batch["transcription"]).input_ids
184
- return batch
185
-
186
- # Apply preprocessing to the dataset
187
- dataset = ds.map(prepare_dataset, remove_columns=ds.column_names)
188
- ```
189
-
190
- ### Fine-Tuning an ASR Model
191
- ```python
192
- from transformers import AutoModelForCTC, TrainingArguments, Trainer
193
-
194
- # Load pre-trained model
195
- model = AutoModelForCTC.from_pretrained("facebook/wav2vec2-large-xlsr-53")
196
-
197
- # Define training arguments
198
- training_args = TrainingArguments(
199
- output_dir="./results",
200
- evaluation_strategy="epoch",
201
- learning_rate=2e-5,
202
- per_device_train_batch_size=16,
203
- num_train_epochs=3,
204
- save_steps=10,
205
- save_total_limit=2,
206
- logging_dir="./logs",
207
- logging_steps=10,
208
- )
209
-
210
- # Initialize Trainer
211
- trainer = Trainer(
212
- model=model,
213
- args=training_args,
214
- train_dataset=dataset,
215
- eval_dataset=dataset,
216
- )
217
-
218
- # Train the model
219
- trainer.train()
220
- ```
221
-
222
- ### Evaluating the Model
223
- ```python
224
- # Evaluate the model
225
- eval_results = trainer.evaluate()
226
- print("Evaluation Results:", eval_results)
227
- ```
228
-
229
- ### Exporting the Model
230
- ```python
231
- # Save the fine-tuned model
232
- model.save_pretrained("./fine_tuned_model")
233
- processor.save_pretrained("./fine_tuned_model")
234
- ```
235
-
236
- ## ๐Ÿ“œ Citation
237
- If you use **MasriSpeech-ASR-Finetuning** in your research or work, please cite it as follows:
238
-
239
- ```
240
- @dataset{masrispeech_asr_finetuning,
241
- author = {Yahya Muhammad Alnwsany},
242
- title = {MasriSpeech-ASR-Finetuning: Egyptian Arabic Speech Fine-Tuning Dataset},
243
- year = {2025},
244
- publisher = {Hugging Face},
245
- url = {https://huggingface.co/collections/NightPrince/masrispeech-dataset-68594e59e46fd12c723f1544}
246
- }
247
- ```
248
-
249
- ## ๐Ÿ“œ Licensing
250
- This dataset is released under the **Apache 2.0 License**. You are free to use, modify, and distribute the dataset, provided you comply with the terms of the license. For more details, see the [LICENSE](https://opensource.org/licenses/Apache-2.0).
251
-
252
- ## ๐Ÿ™Œ Acknowledgments
253
- We would like to thank the following for their contributions and support:
254
- - **Annotators**: For their meticulous work in creating high-quality transcriptions.
255
- - **Hugging Face**: For providing tools and hosting the dataset.
256
- - **Open-Source Community**: For their continuous support and feedback.
257
-
258
- ## ๐Ÿ’ก Use Cases
259
- **MasriSpeech-ASR-Finetuning** can be used in various applications, including:
260
- - Fine-tuning Automatic Speech Recognition (ASR) models for Egyptian Arabic.
261
- - Dialectal Arabic linguistic research.
262
- - Speech synthesis and voice cloning.
263
- - Training and benchmarking machine learning models for low-resource languages.
264
-
265
- ## ๐Ÿค Contributing
266
- We welcome contributions to improve **MasriSpeech-ASR-Finetuning**. If you have suggestions, find issues, or want to add new features, please:
267
- 1. Fork the repository.
268
- 2. Create a new branch for your changes.
269
- 3. Submit a pull request with a detailed description of your changes.
270
-
271
- For questions or feedback, feel free to contact the maintainer.
272
-
273
- ## ๐Ÿ“ Changelog
274
- ### [1.0.0] - 2025-08-02
275
- - Initial release of **MasriSpeech-ASR-Finetuning**.
276
- - Includes 5,500 audio samples with transcriptions.
277
- - Train/validation splits provided.
278
- - Dataset hosted on Hugging Face.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ dataset_info:
3
+ features:
4
+ - name: audio
5
+ dtype: audio
6
+ - name: transcription
7
+ dtype: string
8
+ splits:
9
+ - name: train
10
+ num_bytes: 1110063079
11
+ num_examples: 5000
12
+ - name: validation
13
+ num_bytes: 82102316
14
+ num_examples: 500
15
+ download_size: 1138402984
16
+ dataset_size: 1192165395
17
+ configs:
18
+ - config_name: default
19
+ data_files:
20
+ - split: train
21
+ path: data/train-*
22
+ - split: validation
23
+ path: data/validation-*
24
+ tags:
25
+ - masrispeech
26
+ - egyptian-arabic
27
+ - arabic
28
+ - speech
29
+ - audio
30
+ - asr
31
+ - automatic-speech-recognition
32
+ - speech-to-text
33
+ - stt
34
+ - dialectal-arabic
35
+ - egypt
36
+ - native-speakers
37
+ - spoken-arabic
38
+ - egyptian-dialect
39
+ - arabic-dialect
40
+ - audio-dataset
41
+ - language-resources
42
+ - low-resource-language
43
+ - phonetics
44
+ - speech-corpus
45
+ - voice
46
+ - transcription
47
+ - linguistic-data
48
+ - machine-learning
49
+ - natural-language-processing
50
+ - nlp
51
+ - huggingface
52
+ - open-dataset
53
+ - labeled-data
54
+ task_categories:
55
+ - automatic-speech-recognition
56
+ - audio-classification
57
+ - audio-to-audio
58
+ language:
59
+ - arz
60
+ - ar
61
+ pretty_name: MasriSpeech-ASR-Finetuning
62
+ ---
63
+
64
+
65
+ # ๐Ÿ—ฃ๏ธ MasriSpeech-ASR-Finetuning: Egyptian Arabic Speech Fine-Tuning Dataset
66
+
67
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
68
+ [![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Dataset-blue)](https://huggingface.co/collections/NightPrince/masrispeech-dataset-68594e59e46fd12c723f1544)
69
+
70
+ <p align="center">
71
+ <img src="https://github.com/NightPrinceY/Helmet-V8/blob/main/MasriSpeech.png?raw=true"
72
+ alt="MasriSpeech-Full Dataset Overview"
73
+ width="600"
74
+ height="750"
75
+ style="border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); object-fit: cover; object-position: top;">
76
+ </p>
77
+
78
+ ## ๐ŸŒ Overview
79
+ **MasriSpeech-ASR-Finetuning** is a specialized subset of the MasriSpeech dataset, designed for fine-tuning Automatic Speech Recognition (ASR) models for Egyptian Arabic. This dataset contains 5,500 professionally annotated audio samples totaling over 100 hours of natural Egyptian Arabic speech.
80
+
81
+ > ๐Ÿ’ก **Key Features**:
82
+ > - High-quality 16kHz speech recordings
83
+ > - Natural conversational Egyptian Arabic
84
+ > - Speaker-balanced train/validation splits
85
+ > - Comprehensive linguistic coverage
86
+ > - Apache 2.0 license
87
+
88
+ ## ๐Ÿ“Š Dataset Summary
89
+
90
+ | Feature | Value |
91
+ |--------------------------|---------------------------|
92
+ | **Total Samples** | 5,500 |
93
+ | **Train Samples** | 5,000 |
94
+ | **Validation Samples** | 500 |
95
+ | **Sampling Rate** | 16 kHz |
96
+ | **Total Duration** | ~100 hours |
97
+ | **Languages** | Egyptian Arabic (arz), Arabic (ar) |
98
+ | **Format** | Parquet |
99
+ | **Dataset Size** | 1.19 GB |
100
+ | **Download Size** | 1.13 GB |
101
+ | **Annotations** | Transcripts |
102
+
103
+ ## ๐Ÿงฑ Dataset Structure
104
+ The dataset follows Hugging Face `datasets` format with two splits:
105
+
106
+ ```python
107
+ DatasetDict({
108
+ train: Dataset({
109
+ features: ['audio', 'transcription'],
110
+ num_rows: 5000
111
+ })
112
+ validation: Dataset({
113
+ features: ['audio', 'transcription'],
114
+ num_rows: 500
115
+ })
116
+ })
117
+ ```
118
+ ## Data Fields
119
+
120
+ - **audio**: Audio feature object containing:
121
+ - `Array`: Raw speech waveform (1D float array)
122
+ - `Path`: Relative audio path
123
+ - `Sampling_rate`: 16,000 Hz
124
+ - **transcription**: string with Egyptian Arabic transcription
125
+
126
+ ## ๐Ÿ“ˆ Data Statistics
127
+
128
+ ### Split Distribution
129
+
130
+ | Split | Examples | Size (GB) | Avg. Words | Empty | Non-Arabic |
131
+ |--------------|----------|-----------|------------|-------|------------|
132
+ | **Train** | 5,000 | 1.11 | 13.34 | 0 | 0 |
133
+ | **Validation**| 500 | 0.08 | 9.60 | 0 | 0 |
134
+
135
+ ### Linguistic Analysis
136
+
137
+ | Feature | Train Set | Validation Set |
138
+ |-----------------|---------------------------|----------------------------|
139
+ | **Top Words** | ููŠ (2,025), ูˆ (1,698) | ููŠ (52), ุฃู†ุง (41) |
140
+ | **Top Bigrams** | (ุฅู†, ุฃู†ุง) (130) | (ุดุงุก, ุงู„ู„ู‡) (6) |
141
+ | **Vocab Size** | 3,845 | 789 |
142
+ | **Unique Speakers** | 114 | 10 |
143
+
144
+ <p align="center">
145
+ <img src="https://github.com/NightPrinceY/Helmet-V8/blob/main/train_wordcount_hist.png?raw=true" alt="Train Distribution" width="45%">
146
+ <img src="https://github.com/NightPrinceY/Helmet-V8/blob/main/adapt_wordcount_hist.png?raw=true" alt="Validation Distribution" width="45%">
147
+ <br><em>Word Count Distributions (Left: Train, Right: Validation)</em>
148
+ </p>
149
+
150
+
151
+
152
+ ## How to Use ? ๐Ÿง‘โ€๐Ÿ’ป
153
+
154
+ ### Loading with Hugging Face
155
+ ```python
156
+ from datasets import load_dataset
157
+ import IPython.display as ipd
158
+
159
+ # Load dataset (streaming recommended for large datasets)
160
+ ds = load_dataset('NightPrince/MasriSpeech-ASR-Finetuning',
161
+ split='train',
162
+ streaming=True)
163
+
164
+ # Get first sample
165
+ sample = next(iter(ds))
166
+ print(f"Transcript: {sample['transcription']}")
167
+
168
+ # Play audio
169
+ ipd.Audio(sample['audio']['array'],
170
+ rate=sample['audio']['sampling_rate'])
171
+ ```
172
+
173
+ ### Preprocessing the Dataset
174
+ ```python
175
+ from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC
176
+ from datasets import load_dataset
177
+ import torch
178
+ model_name = "facebook/wav2vec2-base-960h" # Spanish example
179
+ # or "facebook/wav2vec2-large-xlsr-53-en" for English
180
+ processor = Wav2Vec2Processor.from_pretrained(model_name)
181
+ model = Wav2Vec2ForCTC.from_pretrained(model_name)
182
+
183
+ def prepare_dataset(batch):
184
+ audio = batch["audio"]
185
+
186
+ # Extract audio array and sampling rate
187
+ audio_array = audio["array"]
188
+ sampling_rate = audio["sampling_rate"]
189
+
190
+ # Process audio using feature extractor only
191
+ inputs = processor.feature_extractor(
192
+ audio_array,
193
+ sampling_rate=sampling_rate,
194
+ return_tensors="pt"
195
+ )
196
+
197
+ batch["input_values"] = inputs.input_values[0]
198
+
199
+ # Process transcription using tokenizer only
200
+ labels = processor.tokenizer(
201
+ batch["transcription"],
202
+ return_tensors="pt"
203
+ )
204
+
205
+ batch["labels"] = labels["input_ids"][0]
206
+
207
+ return batch
208
+
209
+ # Apply preprocessing to the entire dataset
210
+ print("Processing entire dataset...")
211
+ dataset = ds.map(prepare_dataset, remove_columns=["audio", "transcription"])
212
+ ```
213
+
214
+ ### Fine-Tuning an ASR Model
215
+ ```python
216
+ from transformers import AutoModelForCTC, TrainingArguments, Trainer
217
+
218
+ # Load pre-trained model
219
+ model = AutoModelForCTC.from_pretrained("facebook/wav2vec2-base-960h")
220
+
221
+ # Define training arguments
222
+ training_args = TrainingArguments(
223
+ output_dir="./results",
224
+ evaluation_strategy="epoch",
225
+ learning_rate=2e-5,
226
+ per_device_train_batch_size=16,
227
+ num_train_epochs=3,
228
+ save_steps=10,
229
+ save_total_limit=2,
230
+ logging_dir="./logs",
231
+ logging_steps=10,
232
+ )
233
+
234
+ # Initialize Trainer
235
+ trainer = Trainer(
236
+ model=model,
237
+ args=training_args,
238
+ train_dataset=dataset,
239
+ eval_dataset=dataset,
240
+ )
241
+
242
+ # Train the model
243
+ trainer.train()
244
+ ```
245
+
246
+ ### Evaluating the Model
247
+ ```python
248
+ # Evaluate the model
249
+ eval_results = trainer.evaluate()
250
+ print("Evaluation Results:", eval_results)
251
+ ```
252
+
253
+ ### Exporting the Model
254
+ ```python
255
+ # Save the fine-tuned model
256
+ model.save_pretrained("./fine_tuned_model")
257
+ processor.save_pretrained("./fine_tuned_model")
258
+ ```
259
+
260
+ ## ๐Ÿ“œ Citation
261
+ If you use **MasriSpeech-ASR-Finetuning** in your research or work, please cite it as follows:
262
+
263
+ ```
264
+ @dataset{masrispeech_asr_finetuning,
265
+ author = {Yahya Muhammad Alnwsany},
266
+ title = {MasriSpeech-ASR-Finetuning: Egyptian Arabic Speech Fine-Tuning Dataset},
267
+ year = {2025},
268
+ publisher = {Hugging Face},
269
+ url = {https://huggingface.co/collections/NightPrince/masrispeech-dataset-68594e59e46fd12c723f1544}
270
+ }
271
+ ```
272
+
273
+ ## ๐Ÿ“œ Licensing
274
+ This dataset is released under the **Apache 2.0 License**. You are free to use, modify, and distribute the dataset, provided you comply with the terms of the license. For more details, see the [LICENSE](https://opensource.org/licenses/Apache-2.0).
275
+
276
+ ## ๐Ÿ™Œ Acknowledgments
277
+ We would like to thank the following for their contributions and support:
278
+ - **Annotators**: For their meticulous work in creating high-quality transcriptions.
279
+ - **Hugging Face**: For providing tools and hosting the dataset.
280
+ - **Open-Source Community**: For their continuous support and feedback.
281
+
282
+ ## ๐Ÿ’ก Use Cases
283
+ **MasriSpeech-ASR-Finetuning** can be used in various applications, including:
284
+ - Fine-tuning Automatic Speech Recognition (ASR) models for Egyptian Arabic.
285
+ - Dialectal Arabic linguistic research.
286
+ - Speech synthesis and voice cloning.
287
+ - Training and benchmarking machine learning models for low-resource languages.
288
+
289
+ ## ๐Ÿค Contributing
290
+ We welcome contributions to improve **MasriSpeech-ASR-Finetuning**. If you have suggestions, find issues, or want to add new features, please:
291
+ 1. Fork the repository.
292
+ 2. Create a new branch for your changes.
293
+ 3. Submit a pull request with a detailed description of your changes.
294
+
295
+ For questions or feedback, feel free to contact the maintainer.
296
+
297
+ ## ๐Ÿ“ Changelog
298
+ ### [1.0.0] - 2025-08-02
299
+ - Initial release of **MasriSpeech-ASR-Finetuning**.
300
+ - Includes 5,500 audio samples with transcriptions.
301
+ - Train/validation splits provided.
302
+ - Dataset hosted on Hugging Face.