Text Classification
Transformers
Arabic
Moroccan Arabic
darija
emotion-recognition
mental-health
nlp
bert
Instructions to use ayatallah/DarijaMind-Evaluative with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ayatallah/DarijaMind-Evaluative with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ayatallah/DarijaMind-Evaluative")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ayatallah/DarijaMind-Evaluative", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Darija Emotion Recognition Model
Model Description
This model is fine-tuned for emotion recognition in Moroccan Darija text.
The architecture is based on DarijaBERT and is designed to classify user messages into emotion categories and emotional intensity levels.
Base Model
- Base model: DarijaBERT-Mix
- Fine-tuning task: Emotion Classification
- Framework: PyTorch
- Library: Transformers
Labels
Emotion Classes
| Label | Emotion |
|---|---|
| 0 | Neutral |
| 1 | Joy |
| 2 | Sadness |
| 3 | Anger |
| 4 | Fear |
| 5 | Surprise |
Intensity Levels
| Label | Level |
|---|---|
| 0 | Low |
| 1 | Medium |
| 2 | High |
Dataset
The model was trained on a Moroccan Darija emotion dataset collected from social media conversations and manually annotated.
Dataset Statistics
| Split | Samples |
|---|---|
| Train | XXXX |
| Validation | XXXX |
| Test | XXXX |
Training Details
Hyperparameters
- Learning Rate: 2e-5
- Batch Size: 16
- Epochs: 5
- Optimizer: AdamW
- Max Sequence Length: 128
Regularization
- Dropout
- Weight Decay
- Early Stopping
Evaluation Results
Emotion Classification
| Metric | Score |
|---|---|
| Accuracy | XX.XX |
| Precision | XX.XX |
| Recall | XX.XX |
| F1-score | XX.XX |
Intensity Classification
| Metric | Score |
|---|---|
| Accuracy | XX.XX |
| Precision | XX.XX |
| Recall | XX.XX |
| F1-score | XX.XX |
Usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "USERNAME/MODEL_NAME"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "كنحس براسي فرحان بزاف اليوم"
inputs = tokenizer(
text,
return_tensors="pt",
truncation=True,
max_length=128
)
with torch.no_grad():
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=-1)
print(prediction.item())
Limitations
- Performance may decrease on dialects outside Moroccan Darija.
- The model can inherit biases from the training data.
- Emotion detection remains challenging for sarcasm and ambiguous contexts.
Citation
@article{elguareh2026darijaemotion,
title={Emotion Recognition in Moroccan Darija using Transformer-Based Models},
author={El Guareh, Ayat Allah and others},
year={2026}
}
Authors
Ayat Allah El Guareh