Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

How Sentiment Analysis works


Published on

This is an introduction for the layman to how sentiment analysis in machines works.

Published in: Technology, Business
  • Login to see the comments

How Sentiment Analysis works

  1. 1. How Sentiment Analysis works in machines (an introduction) Marie-Claire Jenkins                     
  2. 2. What is it? <ul><li>It's software for automatically extracting opinions, emotions and sentiments in text. </li></ul><ul><li>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.  </li></ul><ul><li>We can track products, brands and people for example and determine whether they are viewed positively or negatively on the web.  </li></ul>
  3. 3. We can analyse... <ul><li>                       acts: </li></ul><ul><li>&quot;The painting was more expensive than a Monet&quot; </li></ul><ul><li>                     pinions: </li></ul><ul><li>&quot;I honestly don't like Monet, Pollock is the better artist&quot; </li></ul>
  4. 4. Why would we want to do this? <ul><li>It allows business to track: </li></ul><ul><li>         - Flame detection (bad rants) </li></ul><ul><li>         - New product perception </li></ul><ul><li>         - Brand perception </li></ul><ul><li>         - Reputation management </li></ul><ul><li>         </li></ul><ul><li>It allows individuals to get: </li></ul><ul><li>     - An opinion on something (reviews) on a global scale </li></ul><ul><li>     </li></ul>
  5. 5. Several fields of computing merge <ul><li>Natural language processing </li></ul><ul><li>It deals with the actual text element. It transforms it into a format that the machine can use. </li></ul><ul><li>Artificial intelligence </li></ul><ul><li>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. </li></ul>
  6. 6. The problem has several dimensions <ul><li>1 - How does a machine define subjectivity & sentiment? </li></ul><ul><li>2 - How does a machine analyse polaraity (negative/positive)? </li></ul><ul><li>3 - How does a machine deal with subjective word senses? </li></ul><ul><li>4 - How does a machine assign an opinion rating? </li></ul><ul><li>5 - How does a machine know about sentiment intensity? </li></ul>
  7. 7. What is an opinion? <ul><li>&quot; a personal belief or judgment that is not founded on proof or certainty&quot; (WordNet) </li></ul><ul><li>But: </li></ul><ul><li>“ The fact that an opinion has been widely held is no evidence whatever that it is not utterly absurd.” </li></ul><ul><li>(Bertrand Russell) </li></ul><ul><li>Word of mouth is powerful though... </li></ul>
  8. 8. It's not always easy to differentiate between fact and opinion.
  9. 9. What is an opinion to a machine? <ul><li>It is a &quot;quintuple&quot;, an object made up of 5 different things: </li></ul><ul><li>O j = The thing in question (i.e product)  </li></ul><ul><li>f  jk = a feature of O j </li></ul><ul><li>SO ijkl = the sentiment value of the opinion of the opinion holder h i on feature f jk of object o j at time t l </li></ul><ul><li>These 5 elements have to be identified by the machine </li></ul><ul><li>{defined by Bing Liu in the NLP handbook} </li></ul>
  10. 10. The Quintuple is hard to resolve <ul><li>O j = Named Entity Extraction </li></ul><ul><li>f  jk = Information extraction </li></ul><ul><li>SO  ijkl = Sentiment analysis </li></ul><ul><li>h i = Information extraction </li></ul><ul><li>T i = Data extraction </li></ul><ul><li>All of these problems are as yet unsolved in computer science </li></ul><ul><li>{See Bing Liu} </li></ul>
  11. 11. Language is ambiguous <ul><li>Consider: </li></ul><ul><li>&quot; The watch isn't water resistant &quot; - In a product review this could be negative. </li></ul><ul><li>&quot; As much use as a trapdoor on a lifeboat &quot; - negative but not obvious to the machine. </li></ul><ul><li>&quot; The canon camera is better than the Fisher Price one &quot; - comparisons are hard to classify. </li></ul><ul><li>&quot; imo the ice cream is luuurrrrrrvely &quot; - slang and the way we communicate in general needs to be processed. </li></ul>
  12. 12. The process... <ul><li>1 - Part-of-speech tagging (but also position and more): </li></ul><ul><li>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: </li></ul>S = subject VP = Verb Phrase V = Verb N = Noun NP = Noun Phrase PP = Preposition Det = Determiner Then we extract defined patterns like [Det] + [NN] for example
  13. 13. The process part 2 <ul><li>We look at sentiment orientation (SO) of the patterns we extracted. For example we may have extracted: </li></ul><ul><li>Amazing + Phone </li></ul><ul><li>which is:  </li></ul><ul><li>[JJ] + [NN] (or adjective followed by noun in human) </li></ul><ul><li>The opposite might be &quot;Terrible&quot; for example. In this stage, the machines tries to situate the words on an emotive scale (so to speak). </li></ul>
  14. 14. The process part 3 <ul><li>The average Sentiment orientation of all the phrases we gathered is computed. </li></ul><ul><li>This allows the machine to say something like: </li></ul><ul><li>&quot;Generally people like the new iphone&quot; </li></ul><ul><li>--> They recommend it </li></ul><ul><li>or </li></ul><ul><li>&quot;Generally people hate the new iphone&quot; </li></ul><ul><li>--> They don't recommend it </li></ul>
  15. 15. Classifying sentiments <ul><li>This is very difficult but experiments have been done using: </li></ul><ul><li>   - Naive Bayes  (probabilistic classifier using Bayes theorem) </li></ul><ul><li>                         </li></ul><ul><li>   - Maximum Entropy  (Uses  probability distributions on the basis of partial knowledge ) </li></ul><ul><li>   - Support vector machine (Data is set as 2 vectors in an n-dimensional space) </li></ul><ul><li>Pang et al. found the SVM to be the most accurate classifier (around 80%). </li></ul><ul><li>There are other methods being explored as well. </li></ul>
  16. 16. So does it work? <ul><li>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. </li></ul><ul><li>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.  </li></ul><ul><li>There are commercial systems in place at this time and also systems like NaCTeM  in the research space. </li></ul>
  17. 17. Things to read <ul><li>Sentiment analysis in Text (SFS) </li></ul><ul><li>Opinion mining and sentiment analysis (Bo Pang, Lillian Lee) </li></ul><ul><li>Opinion Extraction, Summarization and Tracking in News and Blog Corpora (Ku, Liang, Chen) </li></ul><ul><li>Sentiment analysis and subjectivity (Bing Liu) </li></ul><ul><li>International sentiment analysis for news and blogs (Bautin) </li></ul><ul><li>Sentiment analysis: does coreference matter? (Nikolov) </li></ul><ul><li>CIKM Workshop on sentiment analysis </li></ul>
  18. 18. In the press <ul><li>Google and sentiment analysis (SeoByTheSea) </li></ul><ul><li>5 ways sentiment analysis is ramping up in 2009 (RWW) </li></ul><ul><li>Mining the web for feelings not facts (NY Times) </li></ul><ul><li>Is sentiment analysis reliable? (Marketing Pilgrim) </li></ul><ul><li>Sentimental searching (Watching the watchers) </li></ul>
  19. 19. Tools for coders <ul><li>SentiWordNet </li></ul><ul><li>LingPipe sentiment analysis </li></ul><ul><li>Long list of tools at CodeSpeak </li></ul><ul><li>The Toolkit for Advanced Discriminative Modeling (TADM) </li></ul><ul><li>RapidMiner </li></ul>
  20. 20. Check out this beautiful visual sentiment system <3 
  21. 21.