gospelgit commited on
Commit
e21691e
·
verified ·
1 Parent(s): f5c464e

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +117 -84
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
- - hausa
13
- - yoruba
14
- - swahili
15
  - autoscientist-challenge
16
- size_categories:
17
- - 10K<n<100K
18
  ---
19
 
20
- # Combined Sentiment Dataset: Hausa, Yorùbá, Swahili
21
-
22
- A stitched multi-source sentiment classification dataset combining three
23
- independently collected sentiment corpora for Hausa, Yorùbá, and Swahili,
24
- built for the [Adaption Labs AutoScientist Challenge](https://adaptionlabs.ai/blog/autoscientist-challenge)
25
- (Language category).
26
-
27
- ## Why this dataset
28
-
29
- Existing sentiment resources for these languages are dominated by a single
30
- domain (Twitter). This dataset combines **three different sources across
31
- three different domains** to reduce domain overfitting and give a more
32
- robust sentiment signal:
33
-
34
- | Source | Domain | Languages | Rows |
35
- |---|---|---|---|
36
- | [AfriSenti](https://github.com/afrisenti-semeval/afrisent-semeval-2023) | Twitter | Hausa, Yorùbá, Swahili | 40,290 |
37
- | [NollySenti](https://github.com/IyanuSh/NollySenti) | Nollywood movie reviews (human-translated) | Hausa, Yorùbá | 2,510 |
38
- | [Neurotech-HQ Swahili](https://github.com/Neurotech-HQ/swahili-sentiment-analysis-dataset) | Social media / product reviews (back-translated) | Swahili | 3,925 |
39
-
40
- ## Dataset structure
41
-
42
- - `text`: the raw text (tweet, movie review, or social media comment)
43
- - `label`: one of `positive`, `negative`, `neutral` (single unified label column)
44
- - `language`: `hausa`, `yoruba`, or `swahili`
45
- - `source`: which of the three original datasets the row came from
46
- - `domain`: `twitter`, `movie_review`, or `social_media_reviews`
47
- - `split`: `train`, `dev`, or `test`
48
-
49
- ## Splits
50
-
51
- All three languages use an identical **70 / 15 / 15** train/dev/test split,
52
- stratified by label, computed after pooling all sources per language
53
- (NOT the original per-source splits see Limitations).
54
-
55
- | Language | Total | Train | Dev | Test |
56
- |---|---|---|---|---|
57
- | Hausa | 23,162 | 16,213 | 3,474 | 3,475 |
58
- | Yorùbá | 16,627 | 11,639 | 2,494 | 2,494 |
59
- | Swahili | 6,936 | 4,855 | 1,040 | 1,041 |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  ## Limitations
62
 
63
- - **Label imbalance across sources**: NollySenti and the Neurotech Swahili
64
- set are binary (positive/negative only). `neutral` examples come
65
- exclusively from AfriSenti, so neutral coverage is thinner relative to
66
- positive/negative for all three languages.
67
- - **Re-split, not original splits**: because splits were recomputed by
68
- pooling sources, this is not directly comparable row-for-row to
69
- benchmarks trained on the original AfriSenti or NollySenti splits (e.g.
70
- `Davlan/afrisenti-twitter-sentiment-afroxlmr-large`). Use as a fresh
71
- baseline, not a drop-in replacement.
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 combined dataset, please cite all three original sources:
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).