Add model card
Browse files
README.md
CHANGED
|
@@ -1,71 +1,84 @@
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
-
|
| 4 |
-
|
| 5 |
tags:
|
| 6 |
-
-
|
| 7 |
-
|
| 8 |
-
-
|
| 9 |
-
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
- name: Homework2_Finetuning
|
| 14 |
-
results: []
|
| 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 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
+
pipeline_tag: text-classification
|
| 4 |
+
license: mit
|
| 5 |
tags:
|
| 6 |
+
- distilbert
|
| 7 |
+
- sentiment
|
| 8 |
+
- football
|
| 9 |
+
- fine-tuning
|
| 10 |
+
model_name: DistilBERT Football Sentiment (Positive vs Negative)
|
| 11 |
+
language:
|
| 12 |
+
- en
|
|
|
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# DistilBERT Football Sentiment — Positive vs Negative
|
| 16 |
+
|
| 17 |
+
## Purpose
|
| 18 |
+
Fine-tune a compact transformer (DistilBERT) to classify short football-related comments as **positive (1)** or **negative (0)**. This supports a course assignment on text modeling and evaluation.
|
| 19 |
+
|
| 20 |
+
## Dataset
|
| 21 |
+
- **Source:** `james-kramer/football_news` on Hugging Face.
|
| 22 |
+
- **Schema:** `text` (string), `label` (0/1).
|
| 23 |
+
- **Task:** Binary sentiment classification (`0=negative`, `1=positive`).
|
| 24 |
+
- **Splits:** Stratified **80/10/10** (train/val/test) created in this notebook.
|
| 25 |
+
- **Cleaning:** Strip text, drop empty/NA rows.
|
| 26 |
+
|
| 27 |
+
## Preprocessing
|
| 28 |
+
- **Tokenizer:** `distilbert-base-uncased` (uncased), `max_length=256`, truncation.
|
| 29 |
+
- **Label mapping:** `{0: "negative", 1: "positive"}`.
|
| 30 |
+
|
| 31 |
+
## Training Setup
|
| 32 |
+
- **Base model:** `distilbert-base-uncased`
|
| 33 |
+
- **Epochs:** 5
|
| 34 |
+
- **Batch size:** 16
|
| 35 |
+
- **Learning rate:** 3e-05
|
| 36 |
+
- **Weight decay:** 0.01
|
| 37 |
+
- **Warmup ratio:** 0.1
|
| 38 |
+
- **Early stopping:** patience = 2 (monitor F1 on validation)
|
| 39 |
+
- **Seed:** 42
|
| 40 |
+
- **Hardware:** Google Colab (GPU)
|
| 41 |
+
|
| 42 |
+
## Metrics (Held-out Test)
|
| 43 |
+
```json
|
| 44 |
+
{
|
| 45 |
+
"eval_loss": 0.0029852271545678377,
|
| 46 |
+
"eval_accuracy": 1.0,
|
| 47 |
+
"eval_precision": 1.0,
|
| 48 |
+
"eval_recall": 1.0,
|
| 49 |
+
"eval_f1": 1.0,
|
| 50 |
+
"eval_runtime": 0.3123,
|
| 51 |
+
"eval_samples_per_second": 352.273,
|
| 52 |
+
"eval_steps_per_second": 22.417,
|
| 53 |
+
"epoch": 4.0
|
| 54 |
+
}
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## Confusion Matrix & Errors
|
| 58 |
+
The Colab notebook includes a confusion matrix for validation and test, plus a short error analysis with example misclassifications and hypotheses (e.g., injury news phrased neutrally but labeled negative).
|
| 59 |
+
| | Pred 0 | Pred 1 |
|
| 60 |
+
|-----------|-------:|-------:|
|
| 61 |
+
| **True 0**| 55 | 0 |
|
| 62 |
+
| **True 1**| 0 | 55 |
|
| 63 |
+
|
| 64 |
+
## Brief Error Analysis (Concrete Examples & Hypotheses)
|
| 65 |
+
No misclassifications were observed in the held-out test split (confusion matrix = perfect).
|
| 66 |
+
However, given the very small dataset size (~30 examples), this likely reflects **overfitting** rather than true robustness.
|
| 67 |
+
|
| 68 |
+
## Limitations & Ethics
|
| 69 |
+
- Dataset size and labeling style can lead to unstable metrics; neutral/ambiguous tone is hard.
|
| 70 |
+
- Sports injury and team-management news may bias wording and labels.
|
| 71 |
+
- For coursework only; not for production or sensitive decisions.
|
| 72 |
+
|
| 73 |
+
## Reproducibility
|
| 74 |
+
- Python: 3.12
|
| 75 |
+
- Transformers: >=4.41
|
| 76 |
+
- Datasets: >=2.19
|
| 77 |
+
- Seed: 42
|
| 78 |
+
|
| 79 |
+
## License
|
| 80 |
+
- Code & weights: MIT (adjust per course guidelines)
|
| 81 |
+
- Dataset: see the original dataset's license/terms
|
| 82 |
+
|
| 83 |
+
## AI Assistance Disclosure
|
| 84 |
+
- GenAI tools assisted with notebook structure and documentation; modeling choices and evaluation were implemented and verified by the author.
|