Loading…
Glossary term
Determining whether text expresses a positive, negative or neutral opinion.
Sentiment analysis classifies text as positive, negative or neutral, or scores it on a scale. It is used to summarize reviews, social posts and support tickets.
Sarcasm, mixed opinions and cultural context make it harder than it looks.
Sentiment with a pretrained pipeline
from transformers import pipeline
classify = pipeline("sentiment-analysis")
print(classify("The battery life is fantastic."))Businesses use it to track customer opinion at a scale no person could read.