gospelgit commited on
Commit
5c0a0aa
·
verified ·
1 Parent(s): f81c9f2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +108 -115
README.md CHANGED
@@ -1,134 +1,127 @@
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).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # African Languages 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
+ > **Companion model**: fine-tuned weights trained on the adapted version of this dataset via
28
+ > AutoScientist are released separately at
29
+ > `gospelgit/African-Languages-Sentiment-Classifier`((https://huggingface.co/gospelgit/African-Languages-Sentiment-Classifier).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  >
31
+ > **File guide for this repo:**
32
+ > - `train.csv` / `validation.csv` / `test.csv` — the **original, clean,
33
+ > human-labeled dataset** described in this card (46,725 rows, 70/15/15
34
+ > split). **Use these files** if you want the source data for your own
35
+ > training pipeline.
36
+ > - `ha_yo_sw_sentimentAnalysis.csv` — the **AutoScientist-adapted version**,
37
+ > produced by AutoScientist's data-evolution step during the AutoScientist
38
+ > Challenge submission process. This is **not** the primary dataset and is
39
+ > included for transparency/reproducibility of that specific challenge
40
+ > submission, not as a recommended starting point.
41
+
42
+ ## Why this dataset
43
+
44
+ Existing sentiment resources for these languages are dominated by a single
45
+ domain (Twitter). This dataset combines **three different sources across
46
+ three different domains** to reduce domain overfitting and give a more
47
+ robust sentiment signal:
48
+
49
+ | Source | Domain | Languages | Rows |
50
+ |---|---|---|---|
51
+ | [AfriSenti](https://github.com/afrisenti-semeval/afrisent-semeval-2023) | Twitter | Hausa, Yorùbá, Swahili | 40,290 |
52
+ | [NollySenti](https://github.com/IyanuSh/NollySenti) | Nollywood movie reviews (human-translated) | Hausa, Yorùbá | 2,510 |
53
+ | [Neurotech-HQ Swahili](https://github.com/Neurotech-HQ/swahili-sentiment-analysis-dataset) | Social media / product reviews (back-translated) | Swahili | 3,925 |
54
+
55
+ ## Dataset structure
56
+
57
+ - `text`: the raw text (tweet, movie review, or social media comment)
58
+ - `label`: one of `positive`, `negative`, `neutral` (single unified label column)
59
+ - `language`: `hausa`, `yoruba`, or `swahili`
60
+ - `source`: which of the three original datasets the row came from
61
+ - `domain`: `twitter`, `movie_review`, or `social_media_reviews`
62
+ - `split`: `train`, `validation`, or `test`
63
+
64
+ ## Splits
65
+
66
+ All three languages use an identical **70 / 15 / 15** train/validation/test
67
+ split, stratified by label, computed after pooling all sources per language
68
+ (not the original per-source splits — see Limitations).
69
+
70
+ | Language | Total | Train | Validation | Test |
71
+ |---|---|---|---|---|
72
+ | Hausa | 23,162 | 16,213 | 3,474 | 3,475 |
73
+ | Yorùbá | 16,627 | 11,639 | 2,494 | 2,494 |
74
+ | Swahili | 6,936 | 4,855 | 1,040 | 1,041 |
75
+
76
+ ## Intended use
77
+
78
+ Training and evaluating sentiment classification models for Hausa, Yorùbá,
79
+ and Swahili particularly for benchmarking multilingual co-optimized
80
+ training approaches (e.g. AutoScientist) against single-source baselines
81
+ like `Davlan/afrisenti-twitter-sentiment-afroxlmr-large`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
 
83
  ## Limitations
84
 
85
+ - **Label imbalance across sources**: NollySenti and the Neurotech Swahili
86
+ set are binary (positive/negative only). `neutral` examples come
87
+ exclusively from AfriSenti, so neutral coverage is thinner relative to
88
+ positive/negative for all three languages.
89
+ - **Re-split, not original splits**: because splits were recomputed by
90
+ pooling sources, this is not directly comparable row-for-row to
91
+ benchmarks trained on the original AfriSenti or NollySenti splits. Use
92
+ as a fresh baseline, not a drop-in replacement.
93
+ - **Neurotech Swahili has no official original split** — an 80/10/10 split
94
+ was assigned with a fixed seed (42) before being pooled and re-split here.
95
+ - **Swahili domain composition differs** from Hausa/Yorùbá: it is roughly
96
+ half Twitter, half social-media/product reviews, while Hausa and Yorùbá
97
+ are Twitter-dominant with a smaller movie-review slice.
98
 
99
  ## Citation
100
 
101
+ If you use this combined dataset, please cite all three original sources:
102
+
103
+ ```
104
+ @inproceedings{muhammad2023afrisenti,
105
+ title={AfriSenti: A Twitter Sentiment Analysis Benchmark for African Languages},
106
+ author={Muhammad, Shamsuddeen Hassan and others},
107
+ year={2023}
108
+ }
109
+
110
+ @inproceedings{shode2023nollysenti,
111
+ title={NollySenti: Leveraging Transfer Learning and Machine Translation for Nigerian Movie Sentiment Classification},
112
+ author={Shode, Iyanuoluwa and Adelani, David Ifeoluwa and Peng, Jing and Feldman, Anna},
113
+ year={2023}
114
+ }
115
+
116
+ @misc{neurotech2021swahili,
117
+ title={Swahili Sentiment Analysis Dataset},
118
+ author={Neurotech-HQ},
119
+ year={2021},
120
+ howpublished={\\url{https://github.com/Neurotech-HQ/swahili-sentiment-analysis-dataset}}
121
+ }
122
+ ```
123
+
124
+ ## Submission context
125
+
126
+ Built for the Adaption Labs AutoScientist Challenge (Language category),
127
+ targeting Hausa, Yorùbá, and Swahili as officially supported languages.