Datasets:
Upload README.md
Browse files
README.md
CHANGED
|
@@ -1,101 +1,134 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
language:
|
| 3 |
- ha
|
| 4 |
- yo
|
| 5 |
- sw
|
| 6 |
-
license: cc-by-4.0
|
| 7 |
-
task_categories:
|
| 8 |
-
- text-classification
|
| 9 |
tags:
|
| 10 |
- sentiment-analysis
|
| 11 |
- african-languages
|
| 12 |
-
-
|
| 13 |
-
-
|
| 14 |
-
- swahili
|
| 15 |
- autoscientist-challenge
|
| 16 |
-
size_categories:
|
| 17 |
-
- 10K<n<100K
|
| 18 |
---
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
-
|
| 43 |
-
-
|
| 44 |
-
-
|
| 45 |
-
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
## Limitations
|
| 62 |
|
| 63 |
-
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
- **Neurotech Swahili has no official original split** — an 80/10/10 split
|
| 73 |
-
was assigned with a fixed seed (42) before being pooled and re-split here.
|
| 74 |
-
- **Swahili domain composition differs** from Hausa/Yorùbá: it is roughly
|
| 75 |
-
half Twitter, half social-media/product reviews, while Hausa and Yorùbá
|
| 76 |
-
are Twitter-dominant with a smaller movie-review slice.
|
| 77 |
|
| 78 |
## Citation
|
| 79 |
|
| 80 |
-
If you use this
|
| 81 |
-
|
| 82 |
-
```
|
| 83 |
-
@inproceedings{muhammad2023afrisenti,
|
| 84 |
-
title={AfriSenti: A Twitter Sentiment Analysis Benchmark for African Languages},
|
| 85 |
-
author={Muhammad, Shamsuddeen Hassan and others},
|
| 86 |
-
year={2023}
|
| 87 |
-
}
|
| 88 |
-
|
| 89 |
-
@inproceedings{shode2023nollysenti,
|
| 90 |
-
title={NollySenti: Leveraging Transfer Learning and Machine Translation for Nigerian Movie Sentiment Classification},
|
| 91 |
-
author={Shode, Iyanuoluwa and Adelani, David Ifeoluwa and Peng, Jing and Feldman, Anna},
|
| 92 |
-
year={2023}
|
| 93 |
-
}
|
| 94 |
-
|
| 95 |
-
@misc{neurotech2021swahili,
|
| 96 |
-
title={Swahili Sentiment Analysis Dataset},
|
| 97 |
-
author={Neurotech-HQ},
|
| 98 |
-
year={2021},
|
| 99 |
-
howpublished={\\url{https://github.com/Neurotech-HQ/swahili-sentiment-analysis-dataset}}
|
| 100 |
-
}
|
| 101 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: togethercomputer/gpt-oss-20b-bf16
|
| 3 |
+
library_name: peft
|
| 4 |
+
license: cc-by-4.0
|
| 5 |
language:
|
| 6 |
- ha
|
| 7 |
- yo
|
| 8 |
- sw
|
|
|
|
|
|
|
|
|
|
| 9 |
tags:
|
| 10 |
- sentiment-analysis
|
| 11 |
- african-languages
|
| 12 |
+
- lora
|
| 13 |
+
- peft
|
|
|
|
| 14 |
- autoscientist-challenge
|
|
|
|
|
|
|
| 15 |
---
|
| 16 |
|
| 17 |
+
# African Languages Sentiment Classifier (Hausa, Yorùbá, Swahili)
|
| 18 |
+
|
| 19 |
+
> ## ⚠️ Read before using this model
|
| 20 |
+
> This is a **LoRA adapter produced by an automated fine-tuning/data-evolution
|
| 21 |
+
> pipeline (Adaption Labs' AutoScientist)**, released as a submission for the
|
| 22 |
+
> [AutoScientist Challenge](https://adaptionlabs.ai/blog/autoscientist-challenge).
|
| 23 |
+
> It is a **research artifact, not a vetted production model**. Before you use
|
| 24 |
+
> it, please understand what it actually is:
|
| 25 |
+
>
|
| 26 |
+
> - It was fine-tuned on a **machine-evolved version of the training data**
|
| 27 |
+
> (AutoScientist's "Adaptive Data" step rewrote/expanded the original
|
| 28 |
+
> labeled examples into `enhanced_prompt` / `enhanced_completion` pairs
|
| 29 |
+
> with synthetic reasoning traces). It was **not** trained directly on the
|
| 30 |
+
> raw human-annotated dataset as-is.
|
| 31 |
+
> - The **evaluation numbers below come from AutoScientist's internal
|
| 32 |
+
> judge-based quality and win-rate metrics**, not standard classification
|
| 33 |
+
> accuracy, precision, recall, or F1. Treat "Grade" and "Win Rate" as
|
| 34 |
+
> AutoScientist's own scoring rubric, not an external, independently
|
| 35 |
+
> reproducible benchmark.
|
| 36 |
+
> - **General-capability win rate slightly regressed** after adaptation
|
| 37 |
+
> (52 → 48, see below) — this model appears to trade a small amount of
|
| 38 |
+
> general capability for task-specific sentiment performance. That's a
|
| 39 |
+
> normal fine-tuning tradeoff, not a bug, but you should know it's there.
|
| 40 |
+
> - This adapter has **not been independently evaluated against the
|
| 41 |
+
> `Davlan/afrisenti-twitter-sentiment-afroxlmr-large` baseline** on a
|
| 42 |
+
> standard accuracy/macro-F1 metric. If you need that comparison, run it
|
| 43 |
+
> yourself before drawing conclusions about relative performance.
|
| 44 |
+
>
|
| 45 |
+
> In short: understand the pipeline behind this artifact before you plug it
|
| 46 |
+
> into anything downstream.
|
| 47 |
+
|
| 48 |
+
## Model Details
|
| 49 |
+
|
| 50 |
+
- **Base model:** `togethercomputer/gpt-oss-20b-bf16`
|
| 51 |
+
- **Adapter type:** LoRA (PEFT), rank 64, alpha 128, target modules `q_proj`/`k_proj`/`v_proj`/`o_proj`
|
| 52 |
+
- **Task formulation:** causal LM, prompt → single-token/word completion (average prompt length 15.56 words, completion length 1 word) — i.e. the model is trained to generate the sentiment label as its next-token completion, not as a traditional classification head
|
| 53 |
+
- **Languages:** Hausa, Yorùbá, Swahili
|
| 54 |
+
- **License:** CC-BY-4.0
|
| 55 |
+
- **Produced via:** [Adaption Labs AutoScientist](https://adaptionlabs.ai/blog/autoscientist-challenge) (Language category submission)
|
| 56 |
+
|
| 57 |
+
## Training Data
|
| 58 |
+
|
| 59 |
+
Trained on an AutoScientist-evolved version of the companion dataset
|
| 60 |
+
[`gospelgit/African-Languages_Sentiments`](https://huggingface.co/datasets/gospelgit/African-Languages_Sentiments),
|
| 61 |
+
which itself combines AfriSenti (Twitter), NollySenti (Nollywood movie
|
| 62 |
+
reviews), and the Neurotech-HQ Swahili sentiment dataset (social
|
| 63 |
+
media/product reviews).
|
| 64 |
+
|
| 65 |
+
- **Adapted dataset size:** 15,280 rows (AutoScientist's "Adaptive Data" step
|
| 66 |
+
rewrote and filtered the original ~46,725-row combined corpus into
|
| 67 |
+
enhanced prompt/completion pairs — see disclaimer above)
|
| 68 |
+
- Labels: `positive`, `negative`, `neutral`
|
| 69 |
+
|
| 70 |
+
## Training Procedure
|
| 71 |
+
|
| 72 |
+
- 5 epochs, 585 total steps
|
| 73 |
+
- Train/eval loss decreased steadily across all 5 epochs (eval loss:
|
| 74 |
+
0.828 → 0.787 → 0.769 → 0.760 → 0.757)
|
| 75 |
+
- Learning rate: warm-up then decay schedule
|
| 76 |
+
- Framework: PEFT 0.15.1
|
| 77 |
+
|
| 78 |
+
## Evaluation (AutoScientist internal metrics)
|
| 79 |
+
|
| 80 |
+
These are AutoScientist's own judge-based scores comparing the base model
|
| 81 |
+
against the fine-tuned ("adapted") model — **not standard accuracy/F1**:
|
| 82 |
+
|
| 83 |
+
| Metric | Before (base) | After (adapted) |
|
| 84 |
+
|---|---|---|
|
| 85 |
+
| Quality score (0–10 scale) | 3.0 | 6.9 (+130% relative) |
|
| 86 |
+
| Grade | E | C |
|
| 87 |
+
| Percentile | 1.3 | 8.4 |
|
| 88 |
+
| Win rate — on this dataset | 44 | 57 |
|
| 89 |
+
| Win rate — general category (all tasks) | 52 | 48 |
|
| 90 |
+
|
| 91 |
+
**Read this table carefully**: task-specific quality improved substantially
|
| 92 |
+
(grade E→C, +130% relative quality score), but the general-category win rate
|
| 93 |
+
slightly *dropped* (52→48), meaning the adaptation traded a small amount of
|
| 94 |
+
general-purpose capability for sentiment-task performance. This is disclosed
|
| 95 |
+
deliberately — don't assume "adapted" is strictly better in every dimension.
|
| 96 |
+
|
| 97 |
+
## Intended Use
|
| 98 |
+
|
| 99 |
+
Sentiment classification (positive/negative/neutral) for short-form text in
|
| 100 |
+
Hausa, Yorùbá, or Swahili, primarily for research and benchmarking purposes
|
| 101 |
+
within the AutoScientist Challenge. Not validated for production deployment.
|
| 102 |
+
|
| 103 |
+
## How to Use
|
| 104 |
+
|
| 105 |
+
```python
|
| 106 |
+
from peft import PeftModel
|
| 107 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 108 |
+
|
| 109 |
+
base_model = AutoModelForCausalLM.from_pretrained("togethercomputer/gpt-oss-20b-bf16")
|
| 110 |
+
model = PeftModel.from_pretrained(base_model, "gospelgit/African-Languages-Sentiment-Classifier")
|
| 111 |
+
tokenizer = AutoTokenizer.from_pretrained("gospelgit/African-Languages-Sentiment-Classifier")
|
| 112 |
+
|
| 113 |
+
prompt = "Classify the sentiment of this text as positive, negative, or neutral: <your text here>"
|
| 114 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 115 |
+
output = model.generate(**inputs, max_new_tokens=5)
|
| 116 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
| 117 |
+
```
|
| 118 |
|
| 119 |
## Limitations
|
| 120 |
|
| 121 |
+
- Evaluated via AutoScientist's internal judge/win-rate system, not an
|
| 122 |
+
external, reproducible benchmark — independent verification is
|
| 123 |
+
recommended before relying on these numbers.
|
| 124 |
+
- Trained on an evolved/rewritten version of the source data, not the raw
|
| 125 |
+
human-annotated labels directly.
|
| 126 |
+
- Slight general-capability regression observed post-adaptation (see table
|
| 127 |
+
above).
|
| 128 |
+
- Swahili has less underlying data than Hausa/Yorùbá — performance may be
|
| 129 |
+
less stable for that language.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
|
| 131 |
## Citation
|
| 132 |
|
| 133 |
+
If you use this model, please also cite the original dataset sources
|
| 134 |
+
listed in the [dataset card](https://huggingface.co/datasets/gospelgit/African-Languages_Sentiments).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|