21
How Sentiment Analysis works in machines (an introduction) Marie-Claire Jenkins

How sentiment analysis works

Embed Size (px)

Citation preview

Page 1: How sentiment analysis works

How Sentiment Analysisworks in machines

(an introduction)

Marie-Claire Jenkins                     

Page 2: How sentiment analysis works

What is it?

It's software for automatically extracting opinions, emotions and sentiments in text.

It allows us to track attitudes and feelings on the web. People write blog posts, comments, reviews and tweets about all sorts of different topics. 

We can track products, brands and people for example and determine whether they are viewed positively or negatively on the web. 

Page 3: How sentiment analysis works

We can analyse...

                      acts:

"The painting was more expensive than a Monet"

                    pinions:

"I honestly don't like Monet, Pollock is the better artist"

Page 4: How sentiment analysis works

Why would we want to do this?

It allows business to track:

        - Flame detection (bad rants)        - New product perception        - Brand perception        - Reputation management        

It allows individuals to get:

    - An opinion on something (reviews) on a global scale    

Page 5: How sentiment analysis works

Several fields of computing merge

Natural language processing

It deals with the actual text element. It transforms it into a format that the machine can use.

Artificial intelligence

It uses the information given by the NLP and uses a lot of maths to determine whether something is negative or positive: it is used for clustering.

Page 6: How sentiment analysis works

The problem has several dimensions

1 - How does a machine define subjectivity & sentiment?

2 - How does a machine analyse polaraity (negative/positive)?

3 - How does a machine deal with subjective word senses?

4 - How does a machine assign an opinion rating?

5 - How does a machine know about sentiment intensity?

Page 7: How sentiment analysis works

What is an opinion?

"a personal belief or judgment that is not founded on proof or certainty" (WordNet)

But:

“The fact that an opinion has been widely held is no evidence whatever that it is not utterly absurd.”(Bertrand Russell)

Word of mouth is powerful though...

Page 8: How sentiment analysis works

It's not always easy to differentiate between fact and opinion.

Page 9: How sentiment analysis works

What is an opinion to a machine?It is a "quintuple", an object made up of 5 different things:

Oj = The thing in question (i.e product) 

f jk = a feature of Oj

SO ijkl = the sentiment value of the opinion of the opinion holder hi on feature fjk of object oj at time tl

These 5 elements have to be identified by the machine

{defined by Bing Liu in the NLP handbook}

Page 10: How sentiment analysis works

The Quintuple is hard to resolve

Oj = Named Entity Extraction

f jk = Information extraction

SO ijkl = Sentiment analysis

hi = Information extraction

Ti = Data extraction

All of these problems are as yet unsolved in computer science

{See Bing Liu}

Page 11: How sentiment analysis works

Language is ambiguous

Consider:

"The watch isn't water resistant" - In a product review this could be negative.

"As much use as a trapdoor on a lifeboat" - negative but not obvious to the machine.

"The canon camera is better than the Fisher Price one" - comparisons are hard to classify.

"imo the ice cream is luuurrrrrrvely" - slang and the way we communicate in general needs to be processed.

Page 12: How sentiment analysis works

The process...

1 - Part-of-speech tagging (but also position and more):

The word in the text (or the sentence) at tagged using a POS-tagger so that it assigns a label to each word, allowing the machine to do something with it. It looks something like this:

S = subjectVP = Verb PhraseV = VerbN = NounNP = Noun PhrasePP = PrepositionDet = Determiner

Then we extract defined patterns like [Det] + [NN] for example

Page 13: How sentiment analysis works

The process part 2

We look at sentiment orientation (SO) of the patterns we extracted. For example we may have extracted:

Amazing + Phone

which is: 

[JJ] + [NN] (or adjective followed by noun in human)

The opposite might be "Terrible" for example. In this stage, the machines tries to situate the words on an emotive scale (so to speak).

Page 14: How sentiment analysis works

The process part 3

The average Sentiment orientation of all the phrases we gathered is computed.

This allows the machine to say something like:

"Generally people like the new iphone"

--> They recommend it

or

"Generally people hate the new iphone"

--> They don't recommend it

Page 15: How sentiment analysis works

Classifying sentiments

This is very difficult but experiments have been done using:

  - Naive Bayes (probabilistic classifier using Bayes theorem)                          - Maximum Entropy (Uses probability distributions on the basis of partial knowledge)

  - Support vector machine (Data is set as 2 vectors in an n-dimensional space)

Pang et al. found the SVM to be the most accurate classifier (around 80%).

There are other methods being explored as well.

Page 16: How sentiment analysis works

So does it work?

The wider your throw the net and the more complex the language, the less accurate the system will be. This is simply due to the level of complexity it has to deal with.

If you want to classifiy sentiments into +/- groups, then you are more likely to get a good result than if you are trying to classify into more exact groups (Excellent, incredible, good...). More granularity requires more accuracy and this in turn requires a deeper understanding of human language. 

There are commercial systems in place at this time and also systems like NaCTeM in the research space.

Page 17: How sentiment analysis works

Things to read

Sentiment analysis in Text (SFS)

Opinion mining and sentiment analysis (Bo Pang, Lillian Lee)

Opinion Extraction, Summarization and Tracking in News and Blog Corpora (Ku, Liang, Chen)

Sentiment analysis and subjectivity (Bing Liu)

International sentiment analysis for news and blogs (Bautin)

Sentiment analysis: does coreference matter? (Nikolov)

CIKM Workshop on sentiment analysis

Page 18: How sentiment analysis works

In the press

Google and sentiment analysis (SeoByTheSea)

5 ways sentiment analysis is ramping up in 2009 (RWW)

Mining the web for feelings not facts (NY Times)

Is sentiment analysis reliable? (Marketing Pilgrim)

Sentimental searching (Watching the watchers)

Page 19: How sentiment analysis works

Tools for coders

SentiWordNet

LingPipe sentiment analysis

Long list of tools at CodeSpeak

The Toolkit for Advanced Discriminative Modeling (TADM)

RapidMiner

Page 20: How sentiment analysis works

Check out this beautiful visual sentiment system <3 

Page 21: How sentiment analysis works

http://www.scienceforseo.com