extract
**Sentiment Analysis**
**Overview**
Sentiment Analysis (Opinion Mining) is the use of NLP to systematically identify, extract, and quantify affective states and subjective information. It determines if a piece of writing is positive, negative, or neutral.
**Levels of Analysis**
**1. Document Level**
Classifying the whole document.
- "This review is Positive."
**2. Sentence Level**
Classifying each sentence.
- "The screen is great." (Positive)
- "But the battery sucks." (Negative)
**3. Aspect-Based Sentiment Analysis (ABSA)**
linking sentiment to specific attributes (Aspects).
- Entity: iPhone
- Aspect: Battery → Sentiment: Negative
- Aspect: Screen → Sentiment: Positive
**Approaches**
**Rule-Based (VADER)**
Uses a dictionary of word scores ("Good" = +1.9, "Bad" = -1.5) and rules for amplifiers ("Very good" > "Good") and negations ("Not good" is negative).
- Good for social media (handles emojis/slang).
- Fast/Cheap.
**Machine Learning (BERT/RoBERTa)**
Deep learning models trained to "read" the full context.
- "The movie was not unpredictable." → Positive (Double negative).
- SOTA accuracy.
**Use Cases**
- **Brand Monitoring**: Tracking Twitter/X mentions during a PR crisis.
- **Stock Trading**: Analyzing news headlines to predict market movement.
- **Customer Support**: Prioritizing angry tickets.
- **Product Analysis**: Aggregating pros/cons from Amazon reviews.
**Challenges**
- **Sarcasm**: "Great, my phone died again." (Machine sees "Great", human sees sarcasm).
- **Nuance**: "The movie was shorter than I expected." (Good or Bad?).
Sentiment analysis turns unstructured voice-of-customer data into tracked metrics.