AfroXLMR-Mini Nigerian Sentiment

Fine-tuned sentiment-classification model based on Davlan/afro-xlmr-mini.

The model is designed for sentiment classification of Nigerian English, Nigerian Pidgin, Hausa, Igbo, and Yoruba, with additional domain adaptation using consented real-world WhatsApp conversations.

Task

Three-class sentiment classification:

  • positive
  • negative
  • neutral

Base Model

Davlan/afro-xlmr-mini

The base model is used independently in another part of the project for multilingual vector embedding generation.

This repository contains the fine-tuned sentiment classifier. It should not be used as the embedding model.

Training Data

General Nigerian-language sentiment data

The training corpus contains 140,256 examples across:

Language Samples
English 76,706
Hausa 22,152
Igbo 15,715
Pidgin 10,556
Yoruba 15,127
Total 140,256

The training pipeline applies language-balanced sampling during fine-tuning so that the dominant English corpus does not overwhelm the lower-resource Nigerian languages.

WhatsApp domain adaptation

An additional 1,058 consented and anonymized WhatsApp messages were used for domain adaptation.

Language Samples
English 500
Pidgin 498
Mixed English/Pidgin 60
Total 1,058

The WhatsApp dataset contains anonymized conversational text and was collected with participant consent.

Training Strategy

The model was trained in two stages:

  1. Multilingual sentiment fine-tuning using the language-balanced others training corpus.
  2. Continued fine-tuning using the WhatsApp training corpus for conversational-domain adaptation.

The WhatsApp test set was kept separate from training.

Evaluation

Evaluation artifacts and benchmark results are provided in:

v1/results/

The results include evaluation information from the multilingual test sets and the held-out WhatsApp test set.

Metrics include class-level and aggregate classification metrics where available.

Model Formats

This repository contains several deployment formats:

v1/
β”œβ”€β”€ final_model/     # Hugging Face Transformers model
β”œβ”€β”€ onnx/            # ONNX model
β”œβ”€β”€ onnx_int8/       # Dynamically quantized INT8 ONNX model
β”œβ”€β”€ results/         # Evaluation and benchmark artifacts
└── deployment/      # Deployment-related files
For CPU-based production inference, the recommended artifact is:

v1/onnx_int8/

Intended Use

This model is intended for:

Nigerian social-media sentiment analysis
Nigerian conversational text analysis
WhatsApp-style sentiment classification
Research involving low-resource African languages
CPU-efficient sentiment inference in backend services
Limitations

Performance may vary substantially across languages, dialects,
code-switching patterns, spelling variations, slang, emojis, and
informal conversational expressions.

The WhatsApp domain-adaptation corpus is substantially smaller than
the general multilingual corpus. Results should therefore not be
interpreted as representing all Nigerian WhatsApp conversations.

The model should not be used for high-stakes decisions involving
individuals.

Privacy

The WhatsApp domain-adaptation data was anonymized before training
and was collected with participant consent.

No personally identifying information should be inferred from the
published model or artifacts.

Deployment

The INT8 ONNX model is intended to be loaded using ONNX Runtime,
making it suitable for CPU inference in a FastAPI backend.

The sentiment classifier is architecturally separate from the
project's AfroXLMR embedding model.

Citation

If you use this model in research or a project, please cite this
repository and the original AfroXLMR-mini model.
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