dsfsi/setswana-sentiment
Viewer • Updated • 7.01k • 75
How to use Ido-shraga/setswana-sentiment-mbert with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="Ido-shraga/setswana-sentiment-mbert") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Ido-shraga/setswana-sentiment-mbert")
model = AutoModelForSequenceClassification.from_pretrained("Ido-shraga/setswana-sentiment-mbert", device_map="auto")The most accurate model in this Setswana sentiment family. mBERT 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.567 |
| Macro-F1 | 0.524 |
Sibling models fine-tuned on the same data with the same recipe for comparison:
| Model | Test accuracy | Test macro-F1 |
|---|---|---|
| this model (mBERT) | 0.567 | 0.524 |
| Ido-shraga/setswana-sentiment-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 mBERT baseline reaches 50.6±0.9 macro-F1 (5-seed mean) — this single-seed model is slightly above that 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-mbert")
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
google-bert/bert-base-multilingual-cased