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

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support