riturajpandey739's picture
Update README.md
c7cde66 verified
metadata
license: mit
datasets:
  - mteb/tweet_sentiment_extraction
language:
  - en
metrics:
  - accuracy
base_model:
  - openai-community/gpt2
pipeline_tag: text-classification
library_name: transformers

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}]