AfriSenti-MOE-Lang

Language-Wise Mixture-of-Experts for African Sentiment Analysis

Overview

AfriSenti-MOE-Lang is a multilingual Language-Wise Mixture-of-Experts (LW-MoE) model developed for sentiment classification across 14 African languages using the AfriSenti dataset.

The model uses a shared multilingual encoder with independent language-specific classification experts.

Each input is routed to its corresponding language expert using its language identifier. This enables individual experts to specialize in sentiment classification for their assigned languages while sharing multilingual representations through the common encoder.

Dataset: AfriSenti

The model is developed using the AfriSenti multilingual sentiment analysis dataset.

The 14 languages covered in the experiments are:

Code Language
amh Amharic
arq Algerian Arabic
ary Moroccan Arabic
hau Hausa
ibo Igbo
kin Kinyarwanda
orm Oromo
pcm Nigerian Pidgin
por Mozambican Portuguese
swa Swahili
tir Tigrinya
tso Xitsonga
twi Twi
yor Yoruba

Classification Task

Three-class sentiment classification:

  • Positive
  • Negative
  • Neutral

Model Architecture

The model consists of:

  1. Shared Multilingual Encoder: Extracts contextual representations from input text.

  2. Language Identification: Identifies the language associated with each input.

  3. Language-Wise Expert Router: Routes each input to its corresponding language expert.

  4. Independent Classification Experts: Each language has a dedicated sentiment classification head.

  5. Sentiment Prediction: Produces the final sentiment classification.

Experimental Results

Using AfroXLMR-Social on AfriSenti, Language-Wise MoE achieves the highest average Macro-F1 among the six evaluated configurations.

Configuration Macro-F1 (%)
Multilingual Fine-Tuning 66.9
Language-Wise MoE 67.7

Key Result: LW-MoE achieves 67.7% average Macro-F1, an improvement of 0.8 percentage points over conventional multilingual fine-tuning.

This result represents the strongest configuration among the evaluated approaches for AfriSenti using AfroXLMR-Social.

Performance is encoder-dependent; the same advantage is not observed with AfriBERTa-large.

Evaluation

Macro-F1 is the primary evaluation metric because it gives equal importance to the sentiment classes.

The research uses PyTorch and Hugging Face Transformers with pretrained multilingual encoders.

Repository Contents

The repository contains:

  • saved_moe_model/: Trained model checkpoint and supporting files.
  • language_class_f1.csv: Language-level classification results.
  • per_language_f1.csv: Per-language evaluation metrics.

The model checkpoint includes the shared encoder, language-specific expert heads, tokenizer configuration, and expert mapping files.

Intended Applications

  • African multilingual sentiment analysis.
  • Low-resource language NLP.
  • Language-specific expert specialization.
  • Multilingual text classification.
  • Mixture-of-Experts research.
  • African language technologies.

Research

"Language Family and Script as Routing Signals for African Multilingual Text Classification."- Submitted to TACL

The released checkpoint focuses specifically on the Language-Wise Mixture-of-Experts (LW-MoE) configuration evaluated on AfriSenti.

Acknowledgements

We acknowledge the AfriSenti dataset contributors and the African NLP research community for advancing multilingual language technologies.

Downloads last month
31
Safetensors
Model size
0.6B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Attahir/AfriSenti-MOE-Model

Finetuned
(6)
this model

Dataset used to train Attahir/AfriSenti-MOE-Model