File size: 17,789 Bytes
378d04a 8eb7f0e 378d04a 3655dbb 378d04a 8eb7f0e ab270e9 8eb7f0e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 |
---
language:
- ar
- arz
tags:
- arabic
- egyptian
- saudi
- dialect
- colloquial
- youtube
- comments
- nlp
- text-generation
- dialect-classification
license: mit
task_categories:
- text-generation
- text-classification
size_categories:
- 100K<n<1M
pretty_name: Arabic Dialect Corpus (Egyptian & Saudi)
dataset_info:
features:
- name: text
dtype: string
- name: label
dtype: string
- name: score
dtype: int64
splits:
- name: train
num_bytes: 255365803
num_examples: 1991193
download_size: 123219948
dataset_size: 255365803
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
---
# 🇪🇬🇸🇦 Arabic Dialect Corpus (Egyptian & Saudi)
## Dataset Description
This dataset contains **150K+ natural, informal Arabic text samples** scraped from high-engagement YouTube discussions. It specifically targets **Egyptian (EG)** and **Saudi (SA)** dialects, filling a critical gap in resources for training LLMs on colloquial Arabic (*Ammiya*) rather than just Modern Standard Arabic (MSA).
### Languages
* **Primary Dialects**:
- Egyptian Arabic (EG) - Cairene and regional Egyptian variants
- Saudi Arabic (SA) - Najdi and Hijazi Gulf variants
- General Arabic (AR) - Mixed or pan-dialectal colloquial Arabic
* **Script**: Arabic script with colloquial spelling conventions
* **Type**: Informal, conversational text
## Dataset Summary
Modern Arabic exists on a spectrum from formal Modern Standard Arabic (MSA) to highly localized dialects. While MSA dominates written content, colloquial dialects (*Ammiya*) dominate everyday communication, social media, and informal contexts. This dataset provides:
* **Authentic dialect data**: Real conversations from native speakers
* **Regional coverage**: Two major Arabic dialect groups (Egyptian and Gulf)
* **Simple labeling**: Clean 3-field schema (text, label, score)
* **Quality filtering**: Community-validated content via engagement metrics
* **Training-ready format**: JSONL optimized for streaming workflows
## Dataset Structure
### Data Format
Each entry contains:
```json
{
"text": "يا جدعان الفيديو ده تحفة بجد بس محتاج شوية تظبيط في الصوت",
"label": "EG",
"score": 45
}
```
### Data Fields
| Field | Type | Description |
|-------|------|-------------|
| `text` | string | Cleaned Arabic comment text (colloquial dialect) |
| `label` | string | Dialect label: "EG" (Egyptian), "SA" (Saudi), or "AR" (General Arabic) |
| `score` | int64 | Community engagement score (like count) |
## Dataset Statistics
### Overview
* **Total Entries**: ~150,000+
* **Source Platform**: YouTube
* **Content Type**: User comments and discussions
* **Dialect Coverage**: Egyptian and Saudi Arabian variants
* **Average Text Length**: 15-80 words per entry
* **Quality Range**: Filtered for minimum engagement and coherence
### Label Distribution
| Label | Description | Percentage |
|-------|-------------|------------|
| `EG` | Egyptian Arabic (Cairene and regional variants) | ~60% |
| `SA` | Saudi Arabic (Najdi, Hijazi variants) | ~35% |
| `AR` | General colloquial Arabic (mixed or unidentified) | ~5% |
### Content Distribution
The dataset draws from multiple video categories to ensure diverse vocabulary and contexts:
* **Talk Shows & Podcasts**: 35%
* **Technology Reviews**: 25%
* **Entertainment & Comedy**: 20%
* **Social Commentary**: 15%
* **Other**: 5%
## Dialect Information
### Label Classification
The `label` field indicates the dialect type:
* **EG**: Egyptian Arabic markers detected (e.g., إزيك, يعني, عايز, كده, بتاع)
* **SA**: Saudi/Gulf Arabic markers detected (e.g., وش, كيف, عندك, ياخي, حق)
* **AR**: Mixed or unclear dialectal markers, general colloquial Arabic
**Note**: Classification is automatic and based on dialectal keywords, video metadata, and linguistic patterns. Some entries may contain mixed dialects due to code-switching or regional overlap.
### Egyptian Arabic (EG)
Egyptian Arabic is the most widely understood Arabic dialect due to Egypt's large population (~100M speakers) and cultural influence through media.
**Characteristics**:
* Simplified verb conjugations (no dual forms in verbs)
* Distinct pronunciation (ج as "g", ق as glottal stop)
* Unique vocabulary (e.g., إزيك for "how are you")
* Heavy use of particles like يعني, بقى, كده
### Saudi Arabic (SA)
Includes Najdi (Central) and Hijazi (Western) variants spoken by ~30M people.
**Characteristics**:
* Preservation of classical pronunciation (ج as "j", ق as "q")
* Gulf-specific vocabulary and expressions
* Different question words (وش for "what")
* Distinct verb patterns and negation structures
## Use Cases
### ✅ Recommended Use Cases
* **Dialect Adaptation**: Fine-tune base LLMs (Llama, Mistral, Qwen) for Egyptian/Saudi understanding
* **Continued Pre-training**: Augment model knowledge with colloquial Arabic
* **Sentiment Analysis**: Build classifiers for social monitoring in Egypt and KSA
* **Dialect Identification**: Train discriminators to distinguish regional variants (EG vs SA vs AR)
* **Code-Switching Research**: Study Arabic-English language mixing patterns
* **Cultural NLP**: Analyze slang, humor, and regional expressions
* **Multi-Dialect Models**: Train models that understand multiple Arabic varieties
### ⚠️ Limitations
* **Platform Bias**: YouTube demographics skew younger and more tech-savvy
* **Topic Bias**: Over-representation of entertainment and tech content
* **Register**: Primarily informal; limited formal or professional language
* **Dialect Mixing**: Contains code-switching (Arabic-English) and occasional MSA
* **Size**: Moderate scale (150K) - suitable for fine-tuning but not pre-training from scratch
* **Temporal**: Reflects 2023-2024 language usage and cultural references
## Loading the Dataset
### Using Hugging Face Datasets
```python
from datasets import load_dataset
# Load the entire dataset
dataset = load_dataset("fr3on/arabic-dialect-corpus")
# Access training data
print(f"Dataset size: {len(dataset['train'])} examples")
print(dataset['train'][0])
# Example output:
# {
# 'text': 'يا جدعان الفيديو ده تحفة بجد',
# 'label': 'EG',
# 'score': 45
# }
# Iterate through examples
for example in dataset['train']:
print(example['text'])
print(f"Dialect: {example['label']}")
print(f"Quality score: {example['score']}")
```
### Streaming Mode (for large-scale training)
```python
from datasets import load_dataset
# Enable streaming for memory-efficient loading
dataset = load_dataset(
"fr3on/arabic-dialect-corpus",
split="train",
streaming=True
)
# Process in batches
for batch in dataset.take(1000):
# Your training code here
pass
```
### Filter by Dialect
```python
# Load only Egyptian Arabic samples
dataset = load_dataset("fr3on/arabic-dialect-corpus")
egyptian_data = dataset['train'].filter(
lambda x: x['label'] == 'EG'
)
print(f"Egyptian subset: {len(egyptian_data)} examples")
# Load only Saudi Arabic samples
saudi_data = dataset['train'].filter(
lambda x: x['label'] == 'SA'
)
print(f"Saudi subset: {len(saudi_data)} examples")
# General Arabic only
general_data = dataset['train'].filter(
lambda x: x['label'] == 'AR'
)
print(f"General Arabic subset: {len(general_data)} examples")
```
### Filter by Quality Score
```python
# Load only high-engagement content
dataset = load_dataset("fr3on/arabic-dialect-corpus")
high_quality = dataset['train'].filter(
lambda x: x['score'] >= 50
)
print(f"High-quality subset: {len(high_quality)} examples")
```
## Training Examples
### Continued Language Model Pre-training
```python
from datasets import load_dataset
from transformers import (
AutoTokenizer,
AutoModelForCausalLM,
TrainingArguments,
Trainer,
DataCollatorForLanguageModeling
)
# Load dataset
dataset = load_dataset("fr3on/arabic-dialect-corpus")
# Load base model (e.g., Llama 3)
model_name = "meta-llama/Llama-3-8B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Tokenize the data
def tokenize_function(examples):
return tokenizer(
examples['text'],
truncation=True,
max_length=512,
padding=False
)
tokenized_dataset = dataset.map(
tokenize_function,
batched=True,
remove_columns=['text', 'label', 'score']
)
# Data collator for CLM
data_collator = DataCollatorForLanguageModeling(
tokenizer=tokenizer,
mlm=False # CLM, not MLM
)
# Training arguments
training_args = TrainingArguments(
output_dir="./arabic-dialect-clm",
overwrite_output_dir=True,
num_train_epochs=3,
per_device_train_batch_size=4,
save_steps=10_000,
save_total_limit=2,
learning_rate=2e-5,
warmup_steps=500,
logging_steps=100,
fp16=True,
)
# Trainer
trainer = Trainer(
model=model,
args=training_args,
data_collator=data_collator,
train_dataset=tokenized_dataset['train'],
)
# Train
trainer.train()
```
### Using with Axolotl
Create a config file `dialect-finetune.yml`:
```yaml
base_model: meta-llama/Llama-3-8B
model_type: LlamaForCausalLM
# Dataset configuration
datasets:
- path: fr3on/arabic-dialect-corpus
type: completion
field: text
# Training parameters
sequence_len: 512
num_epochs: 3
micro_batch_size: 4
gradient_accumulation_steps: 4
learning_rate: 0.00002
# Output
output_dir: ./outputs/arabic-dialect
# Optimization
fp16: true
flash_attention: true
```
Then run:
```bash
axolotl train dialect-finetune.yml
```
### Dialect-Aware Sentiment Analysis
```python
from datasets import load_dataset
from transformers import AutoTokenizer, AutoModelForSequenceClassification
# Load dataset
dataset = load_dataset("fr3on/arabic-dialect-corpus")
# Add sentiment labels (you would need to label these)
# For demonstration, we'll filter by score as proxy
def add_sentiment_label(example):
score = example['score']
if score >= 100:
example['label'] = 2 # Positive
elif score >= 20:
example['label'] = 1 # Neutral
else:
example['label'] = 0 # Negative
return example
labeled_dataset = dataset['train'].map(add_sentiment_label)
# Train sentiment classifier
model = AutoModelForSequenceClassification.from_pretrained(
"CAMeL-Lab/bert-base-arabic-camelbert-msa",
num_labels=3
)
```
### Country-Specific Model Training
```python
from datasets import load_dataset
dataset = load_dataset("fr3on/arabic-dialect-corpus")
# Train separate models for each dialect region
dialects = ['EG', 'SA']
for dialect in dialects:
# Filter by dialect label
dialect_data = dataset['train'].filter(
lambda x: x['label'] == dialect
)
dialect_name = {'EG': 'Egyptian', 'SA': 'Saudi'}.get(dialect)
print(f"Training {dialect_name} model with {len(dialect_data)} examples")
# Your training code here
# model = train_model(dialect_data)
# model.save_pretrained(f"./models/arabic-{dialect.lower()}")
# Or train a dialect classifier
def add_dialect_label(example):
label_map = {'EG': 0, 'SA': 1, 'AR': 2}
example['label_id'] = label_map[example['label']]
return example
classifier_data = dataset['train'].map(add_dialect_label)
# Train dialect identification model
```
### Comparative Dialect Analysis
```python
from datasets import load_dataset
from collections import Counter
dataset = load_dataset("fr3on/arabic-dialect-corpus")
# Analyze vocabulary differences
def get_top_words(label, n=100):
dialect_data = dataset['train'].filter(
lambda x: x['label'] == label
)
all_words = []
for example in dialect_data:
words = example['text'].split()
all_words.extend(words)
return Counter(all_words).most_common(n)
# Compare Egyptian vs Saudi vocabulary
egypt_words = get_top_words('EG')
saudi_words = get_top_words('SA')
print("Top Egyptian words:", egypt_words[:10])
print("Top Saudi words:", saudi_words[:10])
```
## Data Collection & Processing
### Source
* **Platform**: YouTube public comments
* **Selection Criteria**: Videos with high engagement (>10K views)
* **Categories**: Talk shows, tech reviews, podcasts, entertainment
* **Date Range**: 2023-2024
### Processing Pipeline
Our rigorous "Data Lab" pipeline ensures high quality:
1. **Ingestion**
- API-based scraping of comment threads
- Focus on high-traffic, organically popular videos
- Collected ~300K raw comments
2. **Normalization**
- Removed emojis, hashtags, and URLs
- Stripped Tatweel/Kashida (مـــصـــر → مصر)
- Collapsed repeated whitespace and newlines
- Normalized Arabic punctuation
3. **Filtering**
- **Length filter**: Removed comments with <3 words (spam/noise)
- **Language detection**: Confirmed Arabic script majority
- **Deduplication**: Hash-based removal of exact duplicates
- **Quality threshold**: Minimum engagement score (like count ≥5)
- **Bot detection**: Pattern-based removal of spam accounts
- **Dialect classification**: Automatic labeling based on dialectal markers and video metadata
4. **Quality Validation**
- Manual spot-checking of random samples (n=1000)
- Automated profanity and toxic content filtering
- Dialect verification for regional authenticity
5. **Export**
- JSONL format for streaming compatibility
- Metadata preservation for filtering/analysis
### Data Quality Metrics
* ✅ **Deduplication Rate**: ~45% duplicates removed
* ✅ **Bot Removal**: ~12% spam accounts filtered
* ✅ **Quality Score Range**: 5-5000+ likes
* ✅ **Manual Validation Accuracy**: 94% dialect correctness
* ✅ **Text Cleanliness**: <1% non-Arabic characters
## Considerations for Using the Data
### Dialectal Arabic Characteristics
Colloquial Arabic differs fundamentally from MSA:
* **Phonology**: Different pronunciation rules (e.g., ج, ق sounds vary)
* **Morphology**: Simplified verb conjugations and case systems
* **Lexicon**: Region-specific vocabulary and loanwords
* **Syntax**: More flexible word order and dropped pronouns
* **Orthography**: Inconsistent spelling conventions
### Recommended Training Approaches
1. **Fine-tune multilingual Arabic models** (e.g., AraGPT2, CAMeL-BERT) rather than training from scratch
2. **Combine with MSA data** to maintain formal language understanding
3. **Use quality filtering** to focus on high-engagement content
4. **Consider domain adaptation** if targeting specific use cases (e.g., tech, entertainment)
5. **Augment with other dialect datasets** for broader coverage
### Code-Switching Handling
This dataset contains natural Arabic-English code-switching (e.g., "يعني basically كده"). If training a monolingual Arabic model, consider:
* Filtering or replacing English words
* Using bilingual tokenizers
* Training on code-switched data intentionally
### Ethical Considerations
* **Public Data**: All content sourced from publicly accessible YouTube comments
* **Privacy**: No personal information (names, emails, addresses) included
* **Anonymization**: Author usernames removed during processing
* **Bias Awareness**: Dataset reflects online youth culture and may not represent all demographics
* **Cultural Sensitivity**: Content filtered for extreme hate speech but may contain strong opinions
* **Intended Use**: Research and model training only; not for surveillance or profiling
## Citation
If you use this dataset in your research, please cite:
```bibtex
@dataset{arabic_dialect_corpus,
title={Arabic Dialect Corpus (Egyptian & Saudi)},
author={fr3on},
year={2026},
publisher={Hugging Face},
url={https://huggingface.co/datasets/fr3on/arabic-dialect-corpus},
note={Natural colloquial Arabic from YouTube discussions}
}
```
## Contributing
We welcome contributions to expand this corpus! You can help by:
### Data Contributions
- Submit PRs with data from other Arabic dialects (Levantine, Iraqi, Moroccan)
- Share preprocessing scripts for other platforms (Twitter, forums)
- Provide domain-specific corpora (medical, legal, technical Arabic)
### Quality Improvements
- Report mislabeled or low-quality examples
- Suggest improved filtering criteria
- Contribute manual dialect annotations
### How to Contribute
1. **Fork** the repository or dataset
2. **Process** your data following the existing JSONL schema:
```json
{
"text": "your_dialect_text",
"label": "EG|SA|AR",
"score": 0
}
```
3. **Document** your data source and processing steps
4. **Submit** a pull request with clear description
## Acknowledgments
* **Community**: YouTube creators and commenters for organic content
* **Tools**: Hugging Face Datasets, Python ecosystem
* **Inspiration**: CAMeL Lab, AraOpus, and other Arabic NLP initiatives
## Version History
* **v1.1.0** (2026-01-06): Expanded dataset
* 350K+ entries
* **v1.0.0** (2026-01-05): Initial release
* 150K+ entries
* Egyptian and Saudi dialects
## License
This dataset is released under the **MIT License**. You are free to:
* ✅ Use for commercial and non-commercial purposes
* ✅ Modify and distribute
* ✅ Train models and publish results
* ✅ Sublicense
**Attribution**: Please cite this dataset in publications and model cards.
---
**Contact & Support**
* **Maintainer**: [fr3on](https://huggingface.co/fr3on)
* **Issues**: [Dataset Discussions](https://huggingface.co/datasets/fr3on/arabic-dialect-corpus/discussions)
* **Community**: Join us in the dataset community tab for questions and feedback
**Dataset Size**: 150K+ examples | **Format**: JSONL | **License**: MIT | **Labels**: EG (Egyptian), SA (Saudi), AR (General) |