sentiment analysis + maxent *

55
Sentiment Analysis + MaxEnt* MAS.S60 Rob Speer Catherine Havasi * Lots of slides borrowed for lots of sources! S

Upload: chi

Post on 24-Feb-2016

80 views

Category:

Documents


0 download

DESCRIPTION

Sentiment Analysis + MaxEnt *. MAS.S60 Rob Speer Catherine Havasi. * Lots of slides borrowed for lots of sources! See end. . People on the Web have opinions. The world is full of text. Customer verbatims Blogs Comments Reviews Forums. Measuring public opinion through social media?. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Sentiment Analysis +  MaxEnt *

Sentiment Analysis + MaxEnt*

MAS.S60Rob Speer

Catherine Havasi

* Lots of slides borrowed for lots of sources! See end.

Page 2: Sentiment Analysis +  MaxEnt *

People on the Web have opinions

Page 3: Sentiment Analysis +  MaxEnt *

The world is full of text• Customer verbatims• Blogs• Comments• Reviews• Forums

Page 4: Sentiment Analysis +  MaxEnt *

People in U.S.

Measuring public opinionthrough social media?

Write

Can we derive a similar measurement?

Query

QueryAggregate

Text Sentiment Measure

I do not

I like Obama

Page 5: Sentiment Analysis +  MaxEnt *

Anne Hathaway

• Oct. 3, 2008 - Rachel Getting Married opens: BRK.A up .44%

• Jan. 5, 2009 - Bride Wars opens: BRK.A up 2.61%• Feb. 8, 2010 - Valentine's Day opens: BRK.A up

1.01%• March 5, 2010 - Alice in Wonderland opens: BRK.A

up .74%• Nov. 24, 2010 - Love and Other Drugs opens: BRK.A

up 1.62%• Nov. 29, 2010 - Anne announced as co-host of the

Oscars: BRK.A up .25%

Page 6: Sentiment Analysis +  MaxEnt *

6

Application: Information Extraction

ICWSM 2008

“The Parliament exploded into fury against the

government when word leaked out…”

Observation: subjectivity often causes false hits for IE

Goal: augment the results of IE

Subjectivity filtering strategies to improve IE Riloff, Wiebe, Phillips AAAI05

Page 7: Sentiment Analysis +  MaxEnt *

Sentiment can be hard to analyze

• http://www.killermovies.com/o/operationcondor/reviews/6na.html

“This is where the money was spent, on well-choreographed kung-fu sequences, on giant Kevlar hamster balls, on smashed-up crates of bananas, and on scorpions. Ignore the gaping holes in the plot (how, exactly, if the villain's legs were broken, did he escape from the secret Nazi base, and why didn't he take the key with him?). Don't worry about the production values, or what, exactly, the Japanese girl was doing hitchhiking across the Sahara. Just go see the movie.”

Page 8: Sentiment Analysis +  MaxEnt *

Thwarted Expectations Narrative

• “I thought it was going to be amazing… but it’s not unless you’re a hungover college student.” – Tripadvisor, Amy’s Café

Page 9: Sentiment Analysis +  MaxEnt *

This is a messy task• Inter-annotator agreement on sentiment

analysis tasks can be as low as 70%• Pang et al., 2002: adding n-grams doesn’t

seem to help

Page 10: Sentiment Analysis +  MaxEnt *

Twitter Mood Swings

Alan Mislove, Northeastern

Page 11: Sentiment Analysis +  MaxEnt *

Daily Mood

Page 12: Sentiment Analysis +  MaxEnt *

Weekly Mood

Page 13: Sentiment Analysis +  MaxEnt *

Opinion mining tasksAt the document (or review) level:

Task: sentiment classification of reviewsClasses: positive, negative, and neutralAssumption: each document (or review) focuses on a single object

(not true in many discussion posts) and contains opinion from a single opinion holder.

At the sentence level:Task 1: identifying subjective/opinionated sentences

Classes: objective and subjective (opinionated)Task 2: sentiment classification of sentences

Classes: positive, negative and neutral.Assumption: a sentence contains only one opinion; not true in many cases.Then we can also consider clauses or phrases.

Page 14: Sentiment Analysis +  MaxEnt *

Opinion Mining Tasks (cont.)At the feature level:

Task 1: Identify and extract object features that have been commented on by an opinion holder (e.g., a reviewer).

Task 2: Determine whether the opinions on the features are positive, negative or neutral.

Task 3: Group feature synonyms.Produce a feature-based opinion summary of multiple reviews.

Opinion holders: identify holders is also useful, e.g., in news articles, etc, but they are usually known in the user generated content, i.e., authors of the posts.

Page 15: Sentiment Analysis +  MaxEnt *

Bags of Words• Look for certain keywords• “Valence” of a word• Advantage: Works quickly• Disadvantage: Lexical Creativity

Page 16: Sentiment Analysis +  MaxEnt *

Sentiment analysis: word counting

• Subjectivity Clues lexicon from OpinionFinder / U Pitt– Wilson et al 2005– 2000 positive, 3600 negative words

• Procedure1. Within topical messages,2. Count messages containing these positive and

negative words

Page 17: Sentiment Analysis +  MaxEnt *

Main resources• Lexicons

• General Inquirer (Stone et al., 1966)

• OpinionFinder lexicon (Wiebe & Riloff, 2005)

• SentiWordNet (Esuli & Sebastiani, 2006)• Annotated corpora

• Used in statistical approaches (Hu & Liu 2004, Pang & Lee 2004)

• MPQA corpus (Wiebe et. al, 2005)

• Tools • Algorithm based on minimum

cuts (Pang & Lee, 2004) • OpinionFinder (Wiebe et. al, 2005)

Page 18: Sentiment Analysis +  MaxEnt *

18

Corpus

ICWSM 2008

• MPQA: www.cs.pitt.edu/mqpa/databaserelease (version 2)

• English language versions of articles from the world press (187 news sources)

• Also includes contextual polarity annotations

• Themes of the instructions:– No rules about how particular words should be annotated.

– Don’t take expressions out of context and think about what they could mean, but judge them as they are used in that sentence.

Page 19: Sentiment Analysis +  MaxEnt *

19

Gold Standards

ICWSM 2008

• Derived from manually annotated data• Derived from “found” data (examples):

– Livejournal Cambria, Havasi 2008

– Blog tags Balog, Mishne, de Rijke EACL 2006

– Websites for reviews, complaints, political arguments

• amazon.com Pang and Lee ACL 2004• complaints.com Kim and Hovy ACL 2006• bitterlemons.com Lin and Hauptmann ACL 2006

• Word lists (example):– General Inquirer Stone et al. 1996

Page 20: Sentiment Analysis +  MaxEnt *

A note on the sentiment list• This list is not well suited for social media English.

– “sucks”, “ :) ”, “ :( ”

(Top examples) word valence count will positive 3934 bad negative 3402 good positive 2655 help positive 1971

(Random examples) word valence count funny positive 114 fantastic positive 37 cornerstone positive 2 slump negative 85 bearish negative 17 crackdown negative 5

Page 21: Sentiment Analysis +  MaxEnt *

21

Patterns

ICWSM 2008

• Lexico-syntactic patterns Riloff & Wiebe 2003

• way with <np>: … to ever let China use force to have its way with …

• expense of <np>: at the expense of the world’s security and stability

• underlined <dobj>: Jiang’s subdued tone … underlined his desire to avoid disputes …

Page 22: Sentiment Analysis +  MaxEnt *

22

Conjunction

ICWSM 2008

Page 23: Sentiment Analysis +  MaxEnt *

23

*We cause great leaders

ICWSM 2008

Page 24: Sentiment Analysis +  MaxEnt *

24

Statistical association

ICWSM 2008

• If words of the same orientation likely to co-occur together, then the presence of one makes the other more probable (co-occur within a window, in a particular context, etc.)

• Use statistical measures of association to capture this interdependence – E.g., Mutual Information (Church &

Hanks 1989)

Page 25: Sentiment Analysis +  MaxEnt *

Sentiment Ratio Moving Average

• High day-to-day volatility.

• Average last k days.• Keyword “jobs”,

k = 1, 7, 30• (Gallup tracking

polls: 3 or 7-day smoothing)

Page 26: Sentiment Analysis +  MaxEnt *

Sentiment Ratio Moving Average

• High day-to-day volatility.

• Average last k days.• Keyword “jobs”,

k = 1, 7, 30• (Gallup tracking

polls: 3 or 7-day smoothing)

Page 27: Sentiment Analysis +  MaxEnt *

Sentiment Ratio Moving Average

• High day-to-day volatility.

• Average last k days.• Keyword “jobs”,

k = 1, 7, 30• (Gallup tracking

polls: 3 or 7-day smoothing)

Page 28: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 29: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 30: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 31: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 32: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 33: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 34: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 35: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 36: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 37: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 38: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 39: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 40: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 41: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 42: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 43: Sentiment Analysis +  MaxEnt *

Smoothed comparisons“jobs” sentiment

Page 44: Sentiment Analysis +  MaxEnt *

Beyond good and bad• Can we identify excitement, embarrassment,

fear, and all kinds of other emotions?

Page 45: Sentiment Analysis +  MaxEnt *

Sentiment as Topics

Page 46: Sentiment Analysis +  MaxEnt *

The Hourglass of Emotions

A quantified version of Robert Plutchik’s psychoevolutionary “wheel of emotions” (1980)

Page 47: Sentiment Analysis +  MaxEnt *

SenticNet• Augments ConceptNet with emotion-tagged

data• Learns a function from semantic vectors to the

emotion space• Evaluation: classify LJ posts that are tagged

with “Current mood: ...”

Page 48: Sentiment Analysis +  MaxEnt *

Learning valence• Most classifiers are effectively learning a

valence for every feature– funny = +1– disappointed = -2– seagal = -3

Page 49: Sentiment Analysis +  MaxEnt *

Naïve Bayes again?• Sure, okay• But interesting n-grams clearly aren’t

independent– “Gwyneth Paltrow” will be double-counted every

time

Page 50: Sentiment Analysis +  MaxEnt *

Maximum Entropy (MaxEnt)• MaxEnt finds a probability distribution that

follows a logistic curve• Doesn’t require independence

Page 51: Sentiment Analysis +  MaxEnt *

The logistic (logit) distribution

• c = class• d = data• f = features in the data• λ = a value for every feature• Z = whatever you need to divide by to make it

add up to 1

Page 52: Sentiment Analysis +  MaxEnt *

MaxEnt learns a probability distribution

• Optimizing for two things:– Maximize the probability of your data– ...but be as uninformative as possible about things

missing from your data

• An unfair coin comes up heads four times. What’s the probability that it comes up heads the next time?

Page 53: Sentiment Analysis +  MaxEnt *

Maximum Likelihood

Page 54: Sentiment Analysis +  MaxEnt *

Maximum A Posteriori• p(class | data) p(data | class) * p(class)∝• posterior = likelihood * prior

• Our prior on p(class) can apply a penalty to large weights

Page 55: Sentiment Analysis +  MaxEnt *

Slide Credits• Brendan O’Connor, CMU – OpinionFinder• Carmen Banea /Jan Wiebe • Luminoso• Smilies: Aditya Joshi