Professional Documents
Culture Documents
Pushpak Bhattacharyya
CSE Dept.,
IIT Bombay and IIT Patna
California
Jan 2018
Jan 18 sarcasm:pushpak 1
Jan 18 sarcasm:pushpak 2
Jan 18 sarcasm:pushpak 3
NLP: At the confluence of linguistics &
computer science
Lexicon Morphology Syntactics Semantics
Linguistics
Morphology Sentiment
Summarization
analyzer Machine Analysis
Translation Information
Ontology Word Retrieval
Parser Sense
generation
Disambiguation
Computer
Graphs Finite-state Parsing Probability Machine Science
& trees machines in theory
compilation learning
Jan 18 sarcasm:pushpak 4
The chain
Jan 18 sarcasm:pushpak 5
Roadmap
NLP and Ambiguity
Sentiment Analysis
Sarcasm
Features and ML
Numerical Sarcasm
Cognitive dimension
Conclusions and future work
Jan 18 sarcasm:pushpak 6
NLP: multilayered, Multi
dimensional Problem
Semantics NLP
Trinity
Parsing
Part of Speech
Tagging
Pragmatics, Discourse
Morph
Increased Analysis Marathi French
Complexity Semantics
Of HMM
Processing
Hindi English
Parsing
CRF
Language
MEMM
Algorithm
Chunking
Jan 18 sarcasm:pushpak 7
Need for NLP
Humongous amount of language data in electronic
form
Unstructured data (like free flowing text) will grow to
40 zetabytes (1 zettabyte= 1021 bytes) by 2020.
How to make sense of this huge data?
Example-1: e-commerce companies need to know
sentiment of online users, sifting through 1 lakh e-
opinions per week: needs NLP
Example-2: Translation industry to grow to $37
billion business by 2020
Jan 18 sarcasm:pushpak 8
Machine Learning
Automatically learning rules and concepts
from data
What is “tableness”
Jan 18 sarcasm:pushpak 10
NLP= Ambiguity Processing
Lexical Ambiguity
Present (Noun/Verb/Adjective; time/gift)
Structural Ambiguity
1 and 2 bed room flats live in ready
Semantic Ambiguity
Flying planes can be dangerous
Pragmatic Ambiguity
I love being ignored (after a party, while
taking leave of the host)
Jan 18 sarcasm:pushpak 11
Another challenge of NLP:
multilinguality
Jan 18 sarcasm:pushpak 12
Rules: when and when not
When the phenomenon is understood AND
expressed, rules are the way to go
Jan 18 sarcasm:pushpak 14
Power of Data- Automatic image labeling
(Oriol Vinyals, Alexander Toshev, Samy Bengio, and
Dumitru Erhan, 2014)
Jan 18 sarcasm:pushpak 16
Main methodology
Object A: extract parts and features
Jan 18 sarcasm:pushpak 18
Sentiment Analysis
Jan 18 sarcasm:pushpak 19
Definition (Liu 2010)
(Liu, 2010) defines a sentiment or opinion as a quintuple-
< oj , f jk , soijkl , hi , tl >,
where
oj is a target object,
f jk is a feature of the object oj,
soijkl is the sentiment value of the opinion
of the opinion holder hi
on feature f jk
of object oj
at time tl
Jan 18 sarcasm:pushpak 20
X3 X2
Discourse
Features
Syntactical
Dependencies
Bag of
Words
Document Sentence Aspect
Discrete Subjectivity
X1
Ordinal Polarities
X4 Value
Dictionary X6
Seed Set
X5
Ontology
Input Text
Feature
Extraction
Lexical
Resources
Classifier
Sentiment
Jan 18 sarcasm:pushpak 22
Challenges
`… falls 284 runs short of
`I suggest you wear your what would have been a
perfume with windows and fourth first-class triple-
doors shut! #sarcasm' century'.
www.cricinfo.com Implicit knowldege
Sarcasm
`The movie may have the
nicest actors, a talented music
director of worldwide acclaim
and the most expensive set
one has ever seen but it fails
to impress'. Thwarting
`He is a deadly football
`keeps you on the edge player’
of your seat’ `You may have deadly snakes
at the camp site at night‘
`Tim Tam. \m/’ Balamurali et al [2011]
Jan 18 sarcasm:pushpak Domain specificity
23
Nature of text
Representative figures for SA
Accuracy
Jan 18 sarcasm:pushpak 24
Sarcasm
Jan 18 sarcasm:pushpak 25
Etymology
Greek: ‘sarkasmós’: ‘to tear flesh with
teeth’
Jan 18 sarcasm:pushpak 26
Definition- Foundation is Irony
Mean opposite of what is on surface
“A form of irony that is intended “Verbal irony that expresses
to express contempt or negative and critical attitudes
ridicule.” toward persons or events.”
(Kreuz and Glucksberg, 1989)
The Free Dictionary
Two datasets:
Sarcastic tweets by Riloff et al (2013)
1 www.meaningcloud.com 31
Clues for Sarcasm
Use of laughter expression
haha, you are very smart xD
Your intelligence astounds me. LOL
Heavy Punctuation
Protein shake for dinner!! Great!!!
Use of emoticons
i LOVE it when people tweet yet ignore my text X-(
Interjections
3:00 am work YAY. YAY.
Capital Letters
SUPER EXCITED TO WEAR MY UNIFORM TO SCHOOL TOMORROW ! ! :D lol.
Jan 18 sarcasm:pushpak 32
Incongruity: at the heart of
things!
I love being ignored
3:00 am work YAY. YAY.
Up all night coughing. yeah me!
No power, Yes! Yes! Thank you storm!
This phone has an awesome battery
back-up of 2 hour (Sarcastic)
Jan 18 sarcasm:pushpak 33
Two kinds of incongruity
Explicit incongruity
Overtly expressed through sentiment words of
both polarities
Contribute to almost 11% of sarcasm
instances
‘I love being ignored’
Implicit incongruity
Covertly expressed through phrases of implied
sentiment
‘I love this paper so much that I made a doggy bag
out of it’
Jan 18 sarcasm:pushpak 34
Sarcasm Detection Using
Semantic incongruity
Jan 18 sarcasm:pushpak 35
Feature Set
(Based on Riloff et al
(2013) )
(Based on Ramteke et al
(2013) )
Jan 18 sarcasm:pushpak 36
Datasets
Jan 18 sarcasm:pushpak 37
Results
Tweet-B
Tweet-A
Discussion-A
Jan 18 sarcasm:pushpak 38
Inter-sentential incongruity
Incongruity may be expressed between
sentences.
We extend our classifier for Discussion-A
by considering posts before the target
post. These posts are ‘elicitor posts’.
Jan 18 sarcasm:pushpak 39
Sentiment and Deep Neural
Nets
Jan 18 sarcasm:pushpak 40
Deep neural net
j …. Output layer
wji (m o/p
…. neurons)
i
Hidden layers
….
…. Input layer
(n i/p neurons)
Part of Speech
Tagging
Discourse and Co reference
Morph
Increased Analysis Marathi French
Complexity Semantics
Of HMM
Processing
Hindi English
Parsing
CRF
Language
MEMM
Algorithm
Chunking
POS tagging
Morphology
Jan 18 sarcasm:pushpak 42
Captuirng Incongruity Using
Word Vectors
Some incongruity may occur without the
presence of sentiment words
Jan 18 sarcasm:pushpak 48
About 17% of sarcastic tweets
have origin in number
This phone has an awesome battery
back-up of 38 hours (Non-sarcastic)
This phone has an awesome battery
back-up of 2 hour (Sarcastic)
This phone has a terrible battery back-
up of 2 hours (Non-sarcastic)
Jan 18 sarcasm:pushpak 49
Numerical Sarcasm
waiting 45 min for the subway in the
freezingcold is so much fun.
well 3 hrs of sleep this is awesome.
gotta read 50 pages and do my math before
tomorrow i'm so excited.
-28 c with the windchill fantastic 2 weeks.
woooo when you're up to 12:30 finishing
you're english paper.
Numerical Sarcasm Dataset
Dataset-1 100000 250000 (Non-
(Sarcastic) Sarcastic)
Dataset-2 8681 (Num 8681 (Non-
Sarcastic) Sarcastic)
● Rule-based System
● Machine Learning
System
● Deep Learning System
Rule-based System (Matching of
NPs)
Two repositories:
Jan 18 sarcasm:pushpak 68
Case Studies Examples
“waiting 45 min for the subway in the freezing cold is so
much fun iswinteroveryet”
Classified as Numeric Sarcastic only by Deep learning based classifier
Jan 18 sarcasm:pushpak 71
NLP-trinity
NLP-tasks
Sentiment/Sarcasm Analysis
Human
Machine Translation
Cognition Annotation
Parsing
Eye-tracking POS Tagging
fMRI/
Brain Imaging
English Hindi German
EEG/MEG
Languages
Reinforcement Learning
Statistical
(Supervised, Semi-supervised, Deep NNs)
Rule Based
Algorithms
72
Eye-tracking Technology
Invasive and non-invasive eye-trackers
73
Nature of Gaze Data
Gaze Point: Position (co-ordinate) of gaze on the screen
74
Eye-movement and Cognition
Eye-Mind Hypothesis (Just and Carpenter, 1980)
When a subject is views a word/object, he or she also processes it
cognitively, for approximately the same amount of time he or she
fixates on it.
75
Harnessing Cognitive Features for
Sarcasm Detection (Mishra and
Bhattacharyya, ACL 2016)
Jan 18 sarcasm:pushpak 76
Features for Sarcasm:
Augmented with cognitive
Textual
(1) Unigrams (2) Punctuations Simple gaze
(3) Implicit incongruity (1) Average Fixation Duration,
(4) Explicit Incongruity (2) Average Fixation Count,
(5) Largest +ve/-ve subsequences (3) Average Saccade Length,
(4) Regression Count,
(6) +ve/-ve word count
(5) Number of words skipped,
(7) Lexical Polarity (6) Regressions from second half to first
(8) Flesch Readability Ease, half,
(9) Word count (7) Position of the word from which the
largest regression starts
Complex gaze
(1) Edge density,
(2) Highest weighted degree
(3) Second Highest weighted degree
(With different edge-weights)
Experiment Setup
Dataset:
994 text snippets : 383 positive and 611 negative, 350 are
sarcastic/ironic
Mixture of Movie reviews, Tweets and sarcastic/ironic quotes
Annotated by 7 human annotators
Annotation accuracy: 70%-90% with Fleiss kappa IAA of
0.62
Classifiers:
Naïve Bayes, SVM, Multi Layered Perceptron
Feature combinations:
Unigram Only
Gaze Only (Simple + Complex)
Textual Sarcasm Features (Joshi et., al, 2015) (Includes unigrams)
Gaze+ Sarcasm
p=0.01
p=0.03
Feature Significance
Predicting Readers’ Sarcasm Understandability
By Modeling Gaze Behavior (Mishra and Bhattacharyya,
AAAI 2016)
Jan 18 sarcasm:pushpak 81
Sarcasm, Cognition and
Eye-movement
Sarcasm often emanates from context incongruity (Campbell and Katz
2012), which, possibly, surprises the reader and enforces a re-analysis of the
text.
In the absence of any information, human brain would start processing the text
in a sequential manner, with the aim of comprehending the literal meaning.
Jan 18 sarcasm:pushpak 88
CNN-FF combination
Jan 18 sarcasm:pushpak 89
Results: Sarcasm Detection
Observations - Sarcasm
Jan 18 sarcasm:pushpak 96