File size: 2,316 Bytes
cf0aab7 2c8d744 cf0aab7 2c8d744 cf0aab7 2c8d744 cf0aab7 2c8d744 cf0aab7 2c8d744 cf0aab7 2c8d744 cf0aab7 2c8d744 cf0aab7 2c8d744 cf0aab7 2c8d744 cf0aab7 2c8d744 cf0aab7 2c8d744 cf0aab7 2c8d744 cf0aab7 2c8d744 cf0aab7 2c8d744 cf0aab7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | # bert-twitter-sentiment-classifier
**Fine-tuned model**: `bert-base-uncased` → **bert-twitter-sentiment-classifier**
**Author:** Aakash (Aakash22134)
**Contact:** saiaakash33333@gmail.com
**License:** apache-2.0
**Languages:** en
---
## Model description
This model is a fine-tuned **BERT** classifier for multi-class emotion / sentiment classification on short Twitter text.
It predicts one of the following classes: **sadness, joy, love, anger, fear, surprise**.
The model was trained on the *twitter_multi_class_sentiment* dataset and demonstrates strong classification performance on the held-out test set.
---
## Training data
- **Dataset:** twitter_multi_class_sentiment (public CSV from example notebook)
- **Train / Validation / Test:** 11200 / 1600 / 3200
- **Preprocessing:** tokenized with `bert-base-uncased` tokenizer, padding + truncation to default BERT max length in the notebook
---
## Training procedure & hyperparameters
- **Base model:** bert-base-uncased
- **Training epochs:** 2
- **Batch size (train/eval):** 64 / 64
- **Learning rate:** 2e-05
- **Weight decay:** 0.01
- **Trainer:** `transformers.Trainer` (Hugging Face Transformers)
- **Notes:** model was trained for 2 epochs in a Colab environment; consider longer training or more data for further improvements.
---
## Evaluation
**Test set results (approx):**
- **Accuracy:** 0.900625
- **F1 (weighted):** 0.900321
**Per-class (precision / recall / f1 / support):**
{
"sadness": {
"precision": 0.93,
"recall": 0.95,
"f1": 0.94,
"support": 933
},
"joy": {
"precision": 0.92,
"recall": 0.91,
"f1": 0.92,
"support": 1072
},
"love": {
"precision": 0.76,
"recall": 0.75,
"f1": 0.76,
"support": 261
},
"anger": {
"precision": 0.91,
"recall": 0.91,
"f1": 0.91,
"support": 432
},
"fear": {
"precision": 0.89,
"recall": 0.88,
"f1": 0.88,
"support": 387
},
"surprise": {
"precision": 0.75,
"recall": 0.72,
"f1": 0.74,
"support": 115
}
}
**Evaluation details:** computed with `sklearn.metrics.classification_report`.
**WandB logs:** https://wandb.ai/saiaakash33333-gitam/huggingface
**Run:** https://wandb.ai/saiaakash33333-gitam/huggingface/runs/qtmurwgd
---
## Usage
_Last updated: 2025-09-29 09:20:19 UTC_ |