GPT-2 Sentiment Analysis for Tweets

Model Details

  • Model Type: GPT-2 (Fine-tuned for sentiment analysis)
  • Model Architecture: Transformer-based language model (GPT-2)
  • Fine-tuned On: mteb/tweet_sentiment_extraction dataset
  • Intended Task: Sentiment Classification (Tweet Sentiment)

Model Overview

This model is a fine-tuned version of GPT-2, trained to classify tweets into sentiment categories. The model was fine-tuned on the mteb/tweet_sentiment_extraction dataset, which contains labeled tweets for sentiment analysis.

The model performs the task of classifying tweets into three sentiment categories:

  • Negative: Label 0
  • Neutral: Label 1
  • Positive: Label 2

This model is suitable for analyzing sentiment in short-form text such as tweets, product reviews, or customer feedback.

Intended Use

The model can be used for the following purposes:

  • Sentiment analysis of short texts (e.g., tweets, reviews, feedback).
  • Customer feedback analysis to classify sentiment in user comments.
  • Social media monitoring to track the sentiment of public opinion about topics, brands, or products.

How to Use

You can use the model with the Hugging Face pipeline API to classify the sentiment of a text input.

Example:

from transformers import pipeline

# Load the fine-tuned model
classifier = pipeline("text-classification", model="riturajpandey739/gpt2-sentiment-analysis-tweets")

# Example text for sentiment classification
text = "This product is amazing! I absolutely love it."

# Get the sentiment prediction
result = classifier(text)

# Output the result
print(result)
# Example Output: [{'label': 'LABEL_2', 'score': 0.9976001381874084}]
Downloads last month
51
Safetensors
Model size
124M params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for riturajpandey739/gpt2-sentiment-analysis-tweets

Finetuned
(1326)
this model

Dataset used to train riturajpandey739/gpt2-sentiment-analysis-tweets