GPT‑2 Tweet Sentiment Classifier
This model is a fine-tuned version of GPT‑2, trained for tweet sentiment classification (negative, neutral, positive) using the MTEB Tweet Sentiment Extraction dataset.
Model Overview
- Base Model: GPT‑2 (decoder-only transformer)
- Dataset: MTEB Tweet Sentiment Extraction. A dataset containing ~27481 training tweets and 3534 test tweets, labeled as negative (0), neutral (1), or positive (2)
- Label Distribution (test set):
- Negative (0): 1001 tweets
- Neutral (1): 1430 tweets
- Positive (2): 1103 tweets
Evaluation Metric
These results reflect robust performance for a GPT‑2-based classifier on this tweet sentiment task.
| Metric | Value |
|---|---|
| Loss | 0.6867 |
| Accuracy | 0.7937 |
| F1 Score | 0.7934 |
| Epochs | 5 |
Training Details
- Epochs: 5
- Evaluation Metrics: Accuracy, F1 Score, Loss
- Tokenizer: GPT-2 tokenizer (GPT2Tokenizer) loaded from "gpt2" and modified to use eos_token as the pad_token
Dataset Details
- Name: MTEB Tweet Sentiment Extraction
- Source: MTEB - Massive Text Embedding Benchmark (dataset link)
- Split Sizes:
- Train: 27481 samples
- Test: 3534 samples
- Text Length:
- Average: ~68 characters
- Range: from 4 to ~142 characters
- Classes: 3 (0 = negative, 1 = neutral, 2 = positive)
License
This model is licensed under the Apache 2.0 License.
Author
Fine-tuned and published by @herrerovir using Hugging Face Transformers.
Usage Example
Loading and using the model via Hugging Face transformers:
from transformers import pipeline
classifier = pipeline("text-classification", model="herrerovir/gpt2-sentiment-tweets")
output = classifier("I can't believe how amazing this is!")
print(output) # e.g., [{'label': 'positive', 'score': 0.94}]
- Downloads last month
- 2
Space using herrerovir/gpt2-tweet-sentiment-model 1
Evaluation results
- Accuracy on MTEB Tweet Sentiment Extractionself-reported0.794
- F1 on MTEB Tweet Sentiment Extractionself-reported0.793