parsing applied to sentiment analysis · • sentiment analysis (opinion mining) is the...
TRANSCRIPT
1
Parsing applied to Sentiment Analysis
Pasing applied to Sentiment Analysis
2
Agenda
• Motivation
• Problem Description
• The Main Task
• Challenges
• Methods
• Resources and Tools
3
Motivation
• The companies seek opinions about their products
and services.
• The consumers seek opinions from other consumers
about products and services.
• The Web contains a large number of sources with a
huge number of opinionated texts. Sources like social
media, emails, blogs, product reviews, and normal
web-pages.
4
Motivation
• Browsing through the sources in order to find the
desired opinions is time-consuming.
• We want a search that is objective.
• Automated opinion mining can be described as a
Natural language processing application.
5
Problem Description
• Sentiment analysis (opinion mining) is the
computational study of people’s opinions, appraisals,
attitudes, and emotions toward entities, individuals,
issues, events, topics and their attributes.
• Text can be broadly categorized into facts and
opinions (Liu [2010]). Facts are objective expressions
about entities, events and their properties. Opinions
are usually subjective expressions that describe
people's sentiments, appraisals or feelings toward
entities, events and their properties.
6
Definitions from Taboada et al. [2011]
• Semantic Analysis or opinion mining refers to the general
method to extract subjectivity and polarity from text.
• Sentiment classification or document-level sentiment
classification aims to find the general sentiment of the author in
an opinionated text.
• Subjectivity classification or sentence-level sentiment
classification is whether a sentence expresses an opinion or
not, and if so, whether the opinion is positive or negative.
• Semantic orientations refer to polarity and strength of words,
phrases, or text.
7
Problem Description
• Different levels: document, sentence, feature, phrase,
word.
• Intensifiers: amplifiers increase the semantic
intensity and downtoners decrease it. The scale is a
list of ordered items or a number.
8
Model of an opinionated document
From Liu [2010]
9
The Main Task
• Close the gap between the string of words and the
model of an opinionated document.
• The opinion in a sentence can be described as an
inference from the discourse-so-far and the common
knowledge about opinion holders, objects, object
features, etc.
• The opinion can be: – positive, neutral, and negative
– Numeric interval
10
The Main Task
11
Challenges
• We look for sentences containing adjectives,
adverbs, and verbs. “Camera X is perfect”, “The
application runs too slowly”, “I hate Camera Y”
• Nested levels of authors: “John hated Camera X”,
said Harry.
• “How could anyone sit through this movie?,” no single
word is obviously negative.
12
Challenges
• Co-reference resolution is the problem of deciding which
noun phrases in the text (mentions) refer to the same real
world entities (are co-referent). “Manchester United, the
team, Alex Ferguson’s men, ManU, Man United, the red
devils …”
• Opinions mean different things in different contexts. For
example, the word “surprise” may refer: – to a feeling (the astonishment you feel when something totally unexpected
happens to you)
– to an event (a sudden unexpected event)
– to an action (the act of surprising someone).
13
Challenges
• For example, “the earphone broke in two days”, is an objective
sentence but it implies a negative opinion. The event result is
negative, because the earphone is supposed to work.
• A movie review can be complex. A fragment from Amazon.co.uk: “... I
watched my children's faces as the story developed, from looks of
pure delight as the Dursleys house was bombarded with owl post, to
hatred as Alan Rickman's Snape bullied the kids and finally to tears
as Ron was knocked from his Knight. ...”. The author’s children’s
reaction watching the film. The characters and the actor’s names. The
film is based on a fantasy book with new words like Muggles and
Quidditch.
14
Challenges
Negation example from Taboada et al. [2011]
• Nobody gives a good performance in this movie (nobody
negates good)
• Out of every one of the fourteen tracks, none of them approach
being weak and are all stellar (none negates weak)
• Just a V-5 engine, nothing spectacular (nothing negates
spectacular)
15
Methods
The first four method descriptions are based on
Liu and Zhang [2012] and the fifth on Socher et al. [2013]
• Document Sentiment Classification
• Sentence Subjectivity and Sentiment Classification
• Opinion Lexicon Expansion
• Aspect-Based Sentiment Analysis
• Recursive models for semantic compositionality
16
Document Sentiment Classification
• Classification based on Supervised Learning
• Classification based on Unsupervised Learning
17
Classification based on Supervised Learning
• Training and testing data are already available. For
example from reviews with a structure.
• Machine learning techniques are used and the main
task of sentiment classification is to engineer an
effective set of features: – Terms and their frequency
– Part of speech
– Opinion words and phrases.
– Negations
– Syntactic dependency. Word dependency based features
generated from parsing or dependency trees
18
Classification based on Unsupervised Learning
Turney (Turney [2002]) presents a simple unsupervised learning
algorithm for classifying reviews as recommended (thumbs up) or
not recommended (thumbs down).
The classification of a review is predicted by the average semantic
orientation of the phrases in the review that contain adjectives or
adverbs.
Comparative (tag JJR) and superlative (tag JJS) adjectives are not
selected.
19
Classification based on Unsupervised Learning
• The first step is to use a part-of-speech tagger to identify phrases in
the input text that contain adjectives or adverbs (Brill [1994]).
The patterns are:
20
Classification based on Unsupervised Learning
• The second step. Find the Semantic Orientation (SO) of a phrase,
phrase, is calculated here as follows:
• Turney used the AltaVista search engine because it contains a NEAR
operator.
21
Classification based on Unsupervised Learning
• The third step is to assign the given review to a class,
recommended or not recommended, based on the average
semantic orientation of the phrases extracted from the review.
22
Sentence Subjectivity Classification
• Given a sentence s, two sub-tasks are performed: – Subjectivity classification: Determine whether s is a subjective sentence
or an objective sentence,
– Sentence-level sentiment classification: If s is subjective, determine
whether it expresses a positive, negative or neutral opinion.
• Knowing that some sentences have positive or negative opinions but
not about what, is of limited use. However, the two sub-tasks are still
useful because (1) it filters out those sentences which contain no
opinions, and (2) after we know what entities and aspects of the
entities are talked about in a sentence, this step can help us
determine whether the opinions about the entities and their aspects
are positive or negative.
23
Opinion Lexicon Expansion
• Opinion words are employed in many sentiment classification
tasks.
• Apart from individual words, there are also opinion phrases and
idioms, e.g., “cost someone an arm and a leg”. Collectively, they
are called the opinion lexicon
• In order to compile or collect the opinion word list, three main
approaches have been investigated: manual approach,
dictionary-based approach, and corpus-based approach. we
discuss the two automated approaches.
24
Dictionary-based Approach
• One of the simple techniques in this approach is based on
bootstrapping using a small set of seed opinion words and
an online dictionary
25
Dictionary-based Approach
• The newly found words are added to the seed list. The next iteration
starts. The iterative process stops when no more new words are
found.
• The dictionary based approach and the opinion words collected from it
have a major shortcoming. The approach is unable to find opinion
words with domain and context specific orientations, which is quite
common. For example, for a speaker phone, if it is quiet, it is usually
negative. However, for a car, if it is quiet, it is positive. The corpus-
based approach can help deal with this problem.
26
Corpus-based Approach
• This approach relies on syntactic or co-occurrence patterns and also a
seed list of opinion words to find other opinion words in a large corpus.
• The idea comes from Hazivassiloglou and McKeown [1997]. The
starting point is a list of seed opinion adjectives, and they are used
together with a set of linguistic constraints or conventions on
connectives to identify additional adjective opinion words and their
orientations.
• Rules or constraints are designed for the connectives: AND, OR, BUT,
EITHER-OR, and NEITHER-NOR. This idea is called sentiment
consistency.
27
Corpus-based Approach
• Same and different-orientation links between adjectives form a graph.
Finally, clustering is performed on the graph to produce two sets of
words: positive and negative.
• Just because a word or phrase is listed in an opinion lexicon does not
mean that it actually is expressing an opinion in a sentence. For
example, in the sentence, “I am looking for a good health insurance”,
“good” does not express either a positive or negative opinion on any
particular insurance.
28
Aspect-Based Sentiment Analysis
• Aspect-based sentiment analysis use deeper natural
language processing capabilities which produce a richer
set of results.
• A lexicon-based approach (Ding et al. [2008], Hu and Liu
[2004]) has been shown to perform quite well.
• It also considers opinion shifters and “but”-clauses.
29
Aspect-Based Sentiment Analysis
• Mark opinion words and phrases. Each positive word is assigned +1,
each negative word is assigned -1.
• Handle opinion shifters. Negation words like “not”, “never”, “none”,
“nobody”, “nowhere”, “neither” and “cannot” are the most common type.
• Handle “but”-clauses. A sentence containing “but” is handled by
applying the following rule: the opinion orientation before “but” and after
“but” are opposite to each other if the opinion on one side cannot be
determined.
• An opinion aggregation function is applied to the resulting opinion
scores to determine the final orientation of the opinion on each aspect in
the sentence.
30
Hierarchical Classifiers
Wei Wei, from NTNU’s Department of Computer and
Information Science, used a Hierarchical classifier
with a Sentiment Ontology Tree in his Sentiment
analysis of product reviews.
Wei Wei, Mining Online Text Data for Sentiment and News Impact
Analysis, PhD thesis, NTNU 2013
31
Recursive models for semantic compositionality
• Short and long sentences are a challenge. Socher et al. found that
many shorter n-grams were neutral, and a long sentence can have a
complex structure.
• From a linguistic or cognitive standpoint, ignoring word order in the
treatment of a semantic task is not plausible (the hard examples of
negation).
• The Stanford Sentiment Treebank
• Recursive Neural Tensor Network (RNTN)
32
The Stanford Sentiment Treebank
• The Stanford Sentiment Treebank is the first corpus with fully
labeled parse trees that allows for a complete analysis of the
compositional effects of sentiment in language.
• The corpus is based on the dataset introduced by Pang and Lee
(2005) and consists of 11,855 single sentences extracted from
movie reviews. It was parsed with the Stanford parser (Klein and
Manning, 2003) and includes a total of 215,154 unique phrases
from those parse trees, each annotated by 3 human judges.
• The Amazon Mechanical Turk was used to label the resulting
215,154 phrases.
33
Neural Network Models
• The recursive neural models have word vector representations
and classification in common.
• The simplest member of this family of neural network models is
the standard recursive neural network (RNN). Each parent
vector pi, is given to the same softmax classifier to compute its
label probabilities.
34
Neural Network Models
• The Matrix-Vector RNN (MV-RNN) is linguistically motivated in
that most of the parameters are associated with words and each
composition function that computes vectors for longer phrases
depends on the actual words being combined.
• One problem with the MV-RNN is that the number of parameters
becomes very large and depends on the size of the vocabulary.
• Socher et al. propose a new model called the Recursive Neural
Tensor Network (RNTN). The main idea is to use the same,
tensor-based composition function for all nodes.
35
Socher et al. compare to commonly used methods that use bag of words
features with Naive Bayes and SVMs, as well as Naive Bayes with bag of
bigram features. Socher et al. also compare to a model that averages
neural word vectors and ignores word order (VecAvg).
36
Resources and Tools
• WordNet and WordNet Gloss Corpus
http://wordnet.princeton.edu
• Amazon's Mechanical Turk service (www.mturk.com)
• The Maryland dictionary (Mohammad et al. [2009])
• WordNet-affect (Strapparava and Valitutti [2004])
• OpenMind Common sense, a large-scale collection of
common sense knowledge
(http://openmind.media.mit.edu)
37
Resources and Tools
• SentiWordNet 3.0, Baccianella et al. [2010]
• Stanford Sentiment Treebank, Socher et al. [2013]
http://nlp.stanford.edu:8080/sentiment/rntnDemo.html
• SenticNet, Cambria et al. [2012]
38
Thank you.
39
40
41
42
43