Views
No views yet
transformers library. You can do so with the following command:pip install transformers1from transformers import pipeline
2
3# Load the sentiment-analysis pipeline
4sentiment_analysis = pipeline("text-classification", model="chawki17/my_sentiment_model")
5
6# Example text
7text = "I love this product!"
8
9# Predict sentiment
10result = sentiment_analysis(text)
11print(result)[{'label': 'POSITIVE', 'score': 0.98}]