Downloads · 30 days
3
6% of all-time downloads
gospelgit/African-Languages-Sentiment-Classifier
African-Languages-Sentiment-Classifier is a machine learning model from gospelgit. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as cc-by-4.0.
A LoRA-adapted sentiment classifier for Hausa, Yorùbá, and Swahili, fine-tuned on a combined dataset of 46,725 rows stitched from three independent sources across three different domains, built to reduce the single-do…
Downloads · 30 days
3
6% of all-time downloads
All-time downloads
54
Public
Repo size
1.2 GB
Likes
0
Public
Click a slice to open those files.
.csv1.1 GB · 87%
From the Hugging Face model README
A LoRA-adapted sentiment classifier for Hausa, Yorùbá, and Swahili, fine-tuned on a combined dataset of 46,725 rows stitched from three independent sources across three different domains, built to reduce the single-domain (Twitter-only) bias common in existing African-language sentiment resources.
togethercomputer/gpt-oss-20b-bf16q_proj/k_proj/v_proj/o_projadaption_gpt_oss_20b_ha_yo_sw_sentiment_1eb424c7This model was trained on a combined dataset built from three sources:
| Source | Domain | Languages | Rows |
|---|---|---|---|
| AfriSenti | Hausa, Yorùbá, Swahili | 40,290 | |
| NollySenti | Nollywood movie reviews (human-translated) | Hausa, Yorùbá | 2,510 |
| Neurotech-HQ Swahili | Social media / product reviews (back-translated) | Swahili | 3,925 |
3-class labels (positive / negative / neutral), 70/15/15 train/dev/test
split per language, stratified by label.
Note on training data adaptation: this adapter was trained on a version of this data that was adapted once via Adaption Labs' AutoScientist — its "Adaptive Data" step rewrote the original rows into
enhanced_prompt/enhanced_completionpairs (15,280 rows after this process) as part of its data-and-recipe co-optimization loop. The dataset used to produce this result is included in this repo, alongside the model weights (see Files and versions).
These are AutoScientist's own judge-based scores comparing the base model against the fine-tuned ("adapted") model — not standard accuracy/F1:
| Metric | Before (base) | After (adapted) |
|---|---|---|
| Quality score (0–10 scale) | 3.0 | 6.9 (+130% relative) |
| Grade | E | C |
| Percentile | 1.3 | 8.4 |
| Win rate — on this dataset | 44 | 57 |
| Win rate — general category (all tasks) | 52 | 48 |
Read this table carefully: task-specific quality improved substantially (grade E→C, +130% relative quality score), but the general-category win rate slightly dropped (52→48), meaning the adaptation traded a small amount of general-purpose capability for sentiment-task performance. This is disclosed deliberately — don't assume "adapted" is strictly better in every dimension.
Sentiment classification (positive/negative/neutral) for short-form text in Hausa, Yorùbá, or Swahili, primarily for research and benchmarking purposes within the AutoScientist Challenge. Not validated for production deployment.
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model = AutoModelForCausalLM.from_pretrained("togethercomputer/gpt-oss-20b-bf16")
model = PeftModel.from_pretrained(base_model, "gospelgit/African-Languages-Sentiment-Classifier")
tokenizer = AutoTokenizer.from_pretrained("gospelgit/African-Languages-Sentiment-Classifier")
prompt = "Classify the sentiment of this text as positive, negative, or neutral: <your text here>"
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=5)
print(tokenizer.decode(output[0], skip_special_tokens=True))
If you use this model, please also cite the original dataset sources listed in the dataset card.