← AI Terminology
Sentiment Analysis
Sentiment analysis is an NLP task that automatically identifies and extracts subjective information from text — typically classifying the emotional tone as positive, negative, or neutral, or producing a sentiment score on a continuous scale.
It is one of the most widely deployed NLP tasks in production.
It is one of the most widely deployed NLP tasks in production.
Why It Matters in AI
Businesses generate millions of customer reviews, social media mentions, and support tickets daily — far too many for humans to read. Sentiment analysis extracts signal at scale: which product features generate negative sentiment? Is brand perception improving? How does earnings call tone correlate with stock price? Financial applications (news sentiment for trading, earnings call analysis) are particularly high-value. Modern LLMs have largely superseded classical sentiment models for nuanced tasks.
Key Points
| Aspect | Description |
|---|---|
| Score | 0.0–1.0 or -1.0–1.0 continuous sentiment score — used in financial applications |
| Neural | RoBERTa, BERT fine-tuned on SST-2, Yelp Review — more accurate on domain-specific text |
| Classical | VADER (rule-based, fast), TextBlob — good for social media; no training required |
| LLM-based | GPT-4, Claude — zero-shot aspect-based sentiment with nuanced understanding |
| Aspect-based | Sentiment per entity/aspect: "battery (negative), screen (positive), price (neutral)" |
| Classification | Positive/Negative/Neutral — simplest form; binary or 3-class; BERT fine-tuned on SST-2 |
Simple Analogy
A mood detector for text: like a therapist who can read between the lines of a letter and say "this person is frustrated about X but pleased with Y", sentiment analysis detects the emotional subtext of written content — at machine speed, across millions of documents.
Common Usage Examples
pipeline("sentiment-analysis", model="cardiffnlp/twitter-roberta-base-sentiment")— HuggingFace- VADER:
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer; sid.polarity_scores(text) - Financial:
finbert = pipeline("sentiment-analysis", model="ProsusAI/finbert")— finance-domain sentiment - Aspect-based: Claude prompt — "For each aspect in this review, rate sentiment as positive/negative/neutral: [text]"
TextBlob(text).sentiment.polarity— quick rule-based sentiment (-1.0 to 1.0)
Summary
In short: Sentiment analysis automatically extracts emotional tone from text — the most widely deployed NLP task in production, enabling businesses to analyse customer feedback, monitor brand perception, and extract financial signals at scale.