🧠 Dz-EmoBERT
To validate the quality of the Dz-Emotion dataset, we fine-tuned a transformer-based model, resulting in Dz-EmoBERT, an emotion classification model for Algerian dialect text.
Dz-EmoBERT is built by fine-tuning a pre-trained language model specialized for Algerian Arabic on the Dz-Emotion dataset, which contains 6,000 manually annotated comments across six emotion classes (Anger, Sadness, Fear, Disgust, Happiness, and Surprise).
📄 Paper
For more information, please visit our paper:
🔹 How to use
1from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
2
3model_name = "Houdna-khilouf/Dz-EmoBERT"
4
5# Load model and tokenizer from Hugging Face
6model = AutoModelForSequenceClassification.from_pretrained(model_name)
7tokenizer = AutoTokenizer.from_pretrained(model_name)
8
9# Fix label mapping
10model.config.id2label = {
11 0: "anger",
12 1: "happy",
13 2: "sadness",
14 3: "fear",
15 4: "disgust",
16 5: "surprise",
17}
18
19model.config.label2id = {v: k for k, v in model.config.id2label.items()}
20
21# Create pipeline
22classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
23
24# Prediction
25result = classifier("راني فرحانة بزاف اليوم")
26
27# Final emotion output
28print("Emotion:", result[0]["label"])
⚙️ Fine-Tuning Details
- Pre-trained model: DziriBERT
- Task: Multi-class emotion classification
- Number of classes: 6
- Training split: 80%
- Validation split: 20%
- Epochs: 10
- Learning rate: 2e-5
- Batch size: 8
📊 Model Performance
Dz-EmoBERT achieves state-of-the-art performance on the Dz-Emotion dataset:
- Accuracy: 94.08%
- Precision: 94.07%
- Recall: 94.08%
- F1-score: 94.07%
This performance significantly outperforms other baseline models:
| Model | Accuracy |
|---|
| ARBERT | 86.00% |
| MARBERT | 91.67% |
| Dz-EmoBERT | 94.08% |
📉 Confusion Matrix
The following confusion matrix shows the performance of Dz-EmoBERT:
🧾 Key Findings
- Fine-tuning on a dialect-specific dataset significantly improves performance
- DziriBERT provides a strong foundation for Algerian NLP tasks
- The Dz-Emotion dataset enables robust emotion classification in low-resource settings
📩 Contact
For any questions or collaboration opportunities:
📚 Citation
If you use this dataset, please cite:
1@inproceedings{khilouf2025dzemotion,
2 title={Dz-Emotion: An Algerian Dialect Dataset for Text-Based Emotion Detection},
3 author={Khilouf, Houdna and Ziani, Amel and Malek, Nada Ahmed and Schwab, Didier and Yakoubi, Mohamed Amine},
4 booktitle={2025 International Conference on Recent Advances in Mathematics and Informatics (ICRAMI)},
5 pages={1--6},
6 year={2025},
7 address={Sousse, Tunisia},
8 doi={10.1109/ICRAMI64946.2025.11472633}
9}