Downloads · 30 days
4
21% of all-time downloads
pranavsethi01/yps1382-allin
yps1382-allin is a machine learning model from pranavsethi01. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This fine-tuned GPT-2 model is designed for sentiment analysis of tweets. Trained on the mteb/tweetsentimentextraction dataset, the model classifies tweets into three sentiment categories Positive, Neutral, and Negative.
Downloads · 30 days
4
21% of all-time downloads
All-time downloads
19
Public
Parameters
124M
498 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors498 MB · 100%
From the Hugging Face model README
This fine-tuned GPT-2 model is designed for sentiment analysis of tweets. Trained on the mteb/tweet_sentiment_extraction dataset, the model classifies tweets into three sentiment categories Positive, Neutral, and Negative.
This model is intended for sentiment analysis of tweets or other short social media texts. It is designed for researchers, developers, and data scientists who want to classify textual data into three sentiment categories: Positive, Neutral, or Negative. End users analyzing sentiment trends based on this model's predictions
The model is fine-tuned on the Tweet Sentiment Extraction dataset
This model was fine-tuned using the Hugging Face Transformers library with the following training configuration:
The testing was performed on the Tweet Sentiment Extraction dataset
The model achieved an accuracy of 73% on the test dataset.
This model is designed for sentiment analysis of tweets or other short social media text. Given an input text, it predicts the sentiment as Positive, Neutral, or Negative.
from datasets import load_dataset
import pandas as pd
from transformers import GPT2ForSequenceClassification
from transformers import TrainingArguments, Trainer
import evaluate
import torch
# Load the model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("pranavsethi01/yps1382-allin")
model = AutoModelForSequenceClassification.from_pretrained("pranavsethi01/yps1382-allin")
# Perform sentiment analysis
inputs = tokenizer("I love Hugging Face!", return_tensors="pt")
outputs = model(**inputs)
predictions = torch.argmax(outputs.logits, dim=-1)
# Output sentiment (0: Negative, 1: Neutral, 2: Positive)
print("Sentiment:", predictions.item())
# Limitations
- ** Bias **: The dataset may contain biased or harmful text, potentially influencing predictions.
- ** Domain Limitations **: Optimized for English tweets; performance may degrade on other text types or languages.
# Ethical Considerations
This model should be used responsibly. Be aware of biases in the training data and avoid deploying the model in sensitive or high-stakes applications without further validation.
# Acknowledgments
- Hugging Face Transformers library
- mteb/tweet_sentiment_extraction dataset