How sentiment analysis works

Preview:

Citation preview

How Sentiment Analysisworks in machines

(an introduction)

Marie-Claire Jenkins                     

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. 

We can analyse...

                      acts:

"The painting was more expensive than a Monet"

                    pinions:

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

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    

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.

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?

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...

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

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}

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}

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.

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

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).

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

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.

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.

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

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)

Tools for coders

SentiWordNet

LingPipe sentiment analysis

Long list of tools at CodeSpeak

The Toolkit for Advanced Discriminative Modeling (TADM)

RapidMiner

Check out this beautiful visual sentiment system <3 

http://www.scienceforseo.com

Recommended