dsfsi/setswana-sentiment
Viewer • Updated • 7.01k • 75
How to use Ido-shraga/setswana-sentiment-afriberta-large with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="Ido-shraga/setswana-sentiment-afriberta-large") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Ido-shraga/setswana-sentiment-afriberta-large")
model = AutoModelForSequenceClassification.from_pretrained("Ido-shraga/setswana-sentiment-afriberta-large", device_map="auto")AfriBERTa-large fine-tuned for 3-class sentiment classification of Setswana (Tswana) tweets: Positive / Negative / Neutral.
Trained on the DSFSI Setswana Sentiment corpus — 3,555 Setswana Twitter posts (2021–2022) annotated by three native speakers (arXiv:2605.27239).
| Metric | Value |
|---|---|
| Accuracy | 0.552 |
| Macro-F1 | 0.504 |
Sibling models fine-tuned on the same data with the same recipe for comparison:
| Model | Test accuracy | Test macro-F1 |
|---|---|---|
| Ido-shraga/setswana-sentiment-mbert | 0.567 | 0.524 |
| this model (afriberta-large) | 0.552 | 0.504 |
| Ido-shraga/setswana-sentiment-afroxlmr-large | 0.532 | 0.405 |
| Ido-shraga/setswana-sentiment-afroxlmr-base | 0.500 | 0.486 |
Note: the DSFSI paper's own AfriBERTa baseline reaches 49.0±2.1 macro-F1 (5-seed mean) — this single-seed model is in the same range.
dsfsi/setswana-sentiment text → consensus_label (train 2,762 / validation 346 / test 346)from transformers import pipeline
clf = pipeline("text-classification", model="Ido-shraga/setswana-sentiment-afriberta-large")
clf("setswana text here")
# [{'label': 'Positive', 'score': 0.98}]
The training data is released under the NOODL license (dsfsi/setswana-sentiment).
@misc{abdulmumin2026temporalsimultaneitypredictsannotation,
title={Temporal Simultaneity Predicts Annotation Quality in Sentiment Corpora},
author={Idris Abdulmumin and Mokgadi Penelope Matloga and Tadesse Destaw Belay and Botshelo Kondowe and Letlhogonolo Mohleleng and Hareaipha Nkopo Letsoalo and Shamsuddeen Hassan Muhammad and Vukosi Marivate},
year={2026},
eprint={2605.27239},
archivePrefix={arXiv},
url={https://arxiv.org/abs/2605.27239},
}
Base model
castorini/afriberta_large