Logo Lanfrica
  • Home
  • Atlas
  • Insights
  • Docs
  • Sign in

© 2026 Lanfrica. All rights reserved. All copyrights of the resources shown on the Lanfrica website belong to the original copyright holders, unless explicitly stated otherwise.

A Performance-efficiency Analysis of Transformer Models for Code-mixed Hausa Sentiment Data

Domain:

natural language processing

Record type:

paper
Creator:
MuhAbdAbdSuf
Publisher:
Spr
Host:
Abstract The deployment of large language models (LLMs) in African contexts offers significant opportunities for societal innovation, but is often hindered by their substantial computational requirements. This challenge is particularly acute for code-mixed Hausa sentiment analysis, where the state-of-the-art (SOTA) model achieves high accuracy at a significant cost in model size and inference speed. This paper addresses this performance-efficiency trade-off by presenting the first comprehensive benchmark of the SOTA model against a suite of smaller, more efficient alternatives, including specialized African-centric and generalist models. Using the established NaijaSenti benchmark, our experiments reveal that a compact, specialized model (castorini/afriberta small) retains over 82% of the SOTA’s F1-score (0.761 vs. 0.928) while being 2.25 times faster at inference. Furthermore, our results demonstrate that specialized pre-training is a critical factor, as the small African-centric model significantly outperforms its generalist counterpart. We conclude that castorini/afriberta small represents the optimal ”sweet spot” for practical deployment, and we recommend it for applications where a balance between high performance and computational efficiency is required. Our findings provide a data-driven guide for practitioners building scalable NLP solutions in the African context.

Visit

doi.org

Tasks

code switchingsentiment analysistext classification

Languages

Hausa

Licenses

https://creativecommons.org/licenses/by/4.0/