mteb/tweet_sentiment_extraction
Viewer • Updated • 30.2k • 3.77k • 38
How to use riturajpandey739/gpt2-sentiment-analysis-tweets with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="riturajpandey739/gpt2-sentiment-analysis-tweets") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("riturajpandey739/gpt2-sentiment-analysis-tweets")
model = AutoModelForSequenceClassification.from_pretrained("riturajpandey739/gpt2-sentiment-analysis-tweets")mteb/tweet_sentiment_extraction datasetThis 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:
This model is suitable for analyzing sentiment in short-form text such as tweets, product reviews, or customer feedback.
The model can be used for the following purposes:
You can use the model with the Hugging Face pipeline API to classify the sentiment of a text input.
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}]
Base model
openai-community/gpt2