Table of Contents
Sentiment Analysis
Sentiment Analysis is monitoring what consumers are saying about a company’s brands and products and how they are expressing their opinions and sentiments to others has always been important to businesses.
- Until the last century, businesses typically used surveys and focus groups from time to time to gauge and track consumer sentiments.
- With the widespread adoption of the Internet, the proliferation of social media channels (such as Twitter, Facebook, and others), and the abundant opportunity for consumers to express their opinions and sentiments, monitoring sentiment continuously has become more critical
“Conventional marketing wisdom long held that a dissatisfied customer tells ten people; but in the age of new social media, he or she has the tools to tell millions,”
Paul Gillin, author of The New Influencers: A Marketer’s Guide to the New Social Media
- The basic task involved in sentiment analysis is identifying and quantifying the polarity or valence of sentiments (such as positive, negative, neutral, or mixed) expressed typically in written opinions, expressions, reviews, comments, and so on
- it involves many of the text analytics steps such as tokenization, sentence identification, part-of-speech tagging, and so on.
- Need to identify statements that convey sentiment
- ”It is an amazing TV“ – conveys sentiment
- ”Do not buy this TV” – conveys sentiment
- ”Which is the best TV?” – conveys no sentiment
- Depending on the context, sentences can be non-comparative (where opinion is restricted to one thing) or comparative (where multiple things might be compared).
Example of a Sentiment Analysis
Consider the following example of a review by a customer for a TV:
The TV is wonderful. Great size, great picture, easy interface It makes a cute little song when you boot it up and when you shut it off I just want to point out that the 43″ does not in fact play videos from the USB This is really annoying because that was one of the major perks I wanted from a new TV Looking at the product description now. I realize that the feature list applies to the X758 series as a whole, and that each model’s capabilities are listed below. Kind of a dumb oversight on my part, but it’s equally stupid to put a description that does not apply on the listing for a very specific model.
Granularity of Sentiment
Sentiment analysis starts with determining whether a text contains an opinion (sentiment). If it does contain sentiment, at what granularity level does the sentiment exist?
- Document level: At this level, the task is to figure out whether the entire document can be classified as positive or negative
- This is possible only if the document involves a single entity (such as the TV in the previous example).
- Sentence level: At this level, the task is to classify each sentence in a document as a positive, negative, or mixed sentiment sentence.
- In the previous example, the first sentence, expresses positive sentiment. The third statement, expresses negative sentiment.
- Entity (or Object) and Attribute (or Aspect or Feature) level: An entity is typically the target of the opinion. However, in many sentences, the sentiments reflect the reviewer’s opinions about attributes (or aspects or features) of the entity
- “Great size, great picture, easy interface”, express positive sentiment for three specific attributes “size, picture, and interface” of the entity, the TV.
Challenges in Conducting Sentiment Analysis
Sentiment analysis starts with text data. So it has all of the typical natural language processing (NLP) problems associated with text analytics, viz.
- identifying part-of-speech tags,
- disambiguating terms and lexicons,
- correcting spelling errors, etc.
Sentiment analysis needs to correctly identifying opinion words that express positive or negative sentiments.
- There are opinion words whose polarity is always the same, e.g. the word “beautiful,” always expresses a positive sentiment.
- But, there are also context-dependent lexicons in which the polarity of the word depends on the domain or context, e.g. the word “small” can be positive or negative depending on the context. The sentence, “The size seems small.” can be positive for a USB flash drive with 1 TB capacity. But, the same sentence can be interpreted as negative if the context is an LED big-screen TV.
In addition to opinion words, there are idiom lexicons— e.g. “costs an arm and a leg” that embody sentiments.
In general, the difficulty with correctly identifying sentiments increases as you move from general to context-dependent to idiom lexicons in texts.
Further challenges in conducting sentiment analysis come from the nature of the text.
- For example, tweets are short, and they are typically focused on one topic only. In that sense, they are easier to analyze. But, tweets often contain a lot of special meaning characters, such as RT (retweets), hashtags (#), emoticons (such as smiley faces), that need to be handled carefully.
- Customer reviews are typically on one entity or object. Therefore, there is less ambiguity in the entity detection task when analyzing reviews.
- Analysis of discussions, free-flow comments, and blog postings is often the hardest because they typically cover multiple entities, make comparisons instead of expressing direct opinions, use a lot of sarcasm, etc.
Unsupervised versus Supervised Sentiment Analysis
- The sentiment analysis can be formulated as a supervised or an unsupervised mining problem, depending on whether there are known examples of documents belonging to positive or negative sentiments.
- Unsupervised sentiment analysis involves the application of a sentiment lexicon of opinion-related positive or negative terms to evaluate text in the document.
- Supervised approach involves machine-learning algorithms (such as support vector machines (SVMs) and neural networks) to textual feature representations to derive the relationships between features of the text segment and the opinions expressed in the document.
- In many situations, known class examples are created by experts who read the documents or use rules, e.g. if a text review’s numeric rating is four or more stars, then the review is positive.
- If no known class examples are possible, then analysts have to use an unsupervised classification of sentiments.
Supervised classification is typically performed at the document level.
- If enough labeled examples are available, commonly used classification models can be trained, validated, and tested to check their performances.
- A good candidate is product review data, which typically has a text review and an overall numeric rating on a scale of one to five stars. Often, a review rating of four to five stars is considered a positive rating, and a review rating of one to two stars is considered a negative rating.
- The main challenge for modelers is to select the inputs from text features such as terms and their frequencies (often weighted or normalized), part-of-speech tags, opinion lexicons (general, context-specific, and idiom), syntactic dependency (from parsing trees), and the handling of negation words (such as “not”).
Unsupervised method is typically applied at the sentence level. There are two types of unsupervised methods: lexicon-based and syntactic-pattern based.
- The lexicon-based approach can be used for sentence- and aspect-level sentiment classification. The relationships between opinion words and attributes are identified via dependency relationships obtained through parsing. For example, in the sentence, “The picture quality is outstanding,” the opinion word “outstanding” and the attribute “picture quality” share the same dependency relationship with the verb “is.”
- If a clear dependency is not observed between an opinion word and an attribute, then how close an opinion word is to an attribute in a sentence can be used to judge the polarity of the attribute. This process can get very complex, depending on how long the sentence is, how many attributes are being mentioned in the same sentence, whether both positive and negative polarity words are used in the same sentence, whether negation is used, and so on. Once sentiment values are computed for each word-attribute combination, they are typically combined using appropriate normalization or weights to come up with an overall sentiment score.
- On the other hand, a syntactic pattern-based approach involves defining part-of-speech tags and the keywords AND, NOR, OR, NOT, BUT, etc. Primarily useful in contextual analysis when performing phrase -level analysis, this method can be used to develop a variety of rules for better accuracy. For example, a simple pattern such as <subject> <NOT> <verb> can be used to extract negative phrases like, “This <feature> does <not> < work> as advertised.”