mteb/tweet_sentiment_extraction
Viewer • Updated • 30.2k • 5.09k • 38
How to use menesnas/fine-tuned-gpt2-tweet-sentiment with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="menesnas/fine-tuned-gpt2-tweet-sentiment") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("menesnas/fine-tuned-gpt2-tweet-sentiment")
model = AutoModelForSequenceClassification.from_pretrained("menesnas/fine-tuned-gpt2-tweet-sentiment", device_map="auto")This is a fine-tuned GPT-2 model for tweet sentiment classification. It categorizes tweets into positive, neutral, or negative sentiment based on their content.
The model was evaluated using the following metrics:
Training Loss: Measures how well the model fits the training data. A lower value indicates better learning.
Validation Loss: Measures how well the model generalizes to unseen data. It is used to detect overfitting.
Accuracy: Percentage of correctly classified samples in the validation dataset. It is the primary performance metric for this sentiment classification task.
| Epoch | Training Loss | Validation Loss | Accuracy |
|---|---|---|---|
| 1 | 0.832400 | 0.871651 | 62.7% |
| 2 | 0.512700 | 0.794255 | 69.3% |
| 3 | 0.517500 | 0.819540 | 71.8% |
Base model
openai-community/gpt2