Applications of Text Analytics: Drunk-texting and Sarcasm

Applications of Text Analytics:
Drunk-texting and Sarcasm
Aditya Joshi
IITB-Monash Research Academy
Joint work with Abhijit Mishra, Vinita Sharma, Balamurali AR,
 
           Prof. Pushpak Bhattacharyya, Prof. Mark James Carman
1
Contact email: adityaj@cse.iitb.ac.in 
Text Analytics
Learning from text
Outline for today:
Introduction
Drunk-texting prediction
Sarcasm prediction
2
Humans learn all the time
 
We learn to drive a car
We learn to cook Maggi
We learn to speak
 
How does a child learn language?
The story of my year-old nephew
 
According to a baby, the first meaning of their
name is...?*
The Kaka anecdote
* : Child language Acquisition; Jean Piaget
How did we learn things?
 
The first time we turned a computer on
A teacher told me exactly which switch to press,
the first time.
Later...?
The first time I came to Wagholi
(in 2012)
Google maps or ...?
The first time my father used Internet banking
Step-by-step: one feature at a time
 
Tell me exactly what to do:
              
Programming
 
I will do a task based on
Similar tasks in the past:
Learning!
 
I will learn each time I do
Something new: 
Online learning!
Machine Learning: Definition
 
A set of methods that can 
automatically detect
patterns 
in data, and then 
use the uncovered
patterns to predict future 
data, or to 
perform
other kinds of decision making
 under
uncertainty
Predict whether a given piece of news is related to
Sports, Politics or Bollywood
Decide whether you want to cross the traffic
 
Can machines do what humans do, seamlessly?
Whose picture is this?
Whose picture is this?
 
A “wombat”
 
A
 
B
Observed examples
 
We recognize an animal, when we have seen one!
The basic source of information for any
machine learning application: 
“Training
instances”
 
Example: 
Text categorization
 
 
The Leader of
Opposition slammed
the current policy of the
Government.
Politics
Australia won the
Cricket World Cup in
Melbourne this
morning.
Sports
Kangana Ranaut won
the award for the Best
Female Actor last week.
Bollywood
A typical ML pipeline
Machine learning
algorithm
Training
Data
A
machine
that has
“learned”
Two types of learning
“Supervised learning”
Input: “Labeled” data set
e.g. “Australia won the Cricket
World Cup”: “Sports”
D: (x,y)  x: data, y: label
y is a member of set of output
labels
“Unsupervised learning”
Input: Unlabeled data set
e.g. Set of Times of India
Articles from 2011-2014
D: (x)
Classification
Predicting an output label, giving input data
Training dataset
A “cat”
classifier
Test example
Is this
a cat?
Lesson 1:
1)
Identify your data
2)
Identify your output labels
A Computational Approach to
Automatic Prediction of
Drunk-Texting
Aditya Joshi
13
First presented at ACL 2015, Beijing, 2015
Goal
Given a tweet,
We wish to 
automatically identify if it was
written under the influence of alcohol.
Our work presents 
the 
first quantitative
evidence that text contains signals that can
be exploited to detect drunk-texting.
14
Motivation
Is this really useful?
Alcohol abuse may lead to unsociable behaviour such as
aggression 
(Bushman and Cooper, 1990)
, crime 
(Carpenter, 
2007)
, suicide
attempts 
(Merrill et al., 1992)
, 
drunk driving 
(Loomis and West, 1958)
, and
risky 
sexual behaviour 
(Bryan et al., 2005)
 and privacy leaks.
Applications:
Investigation following an alcohol abuse incident
NLP-based techniques to prevent regretful drunk-texting
15
Methodology
We use a set of n-gram and stylistic features in
a SVM-based classifier
16
Experiment Setup
Obtaining labeled examples was a challenge. We
use 
distant supervision using hashtags
.
Two datasets were created:
Dataset 1 (2435 drunk, 762 sober): 
Tweets containing
hashtags #drunk, etc
, and those with #notdrunk, etc.
Dataset 2 (2435 drunk, 5644 sober): The drunk tweets
are downloaded using drunk hashtags, as above.
Other tweets by same users are sober tweets.
17
Results (1/2): Which features work
best?
 
18
Results (2/2): What are the top
stylistic features for drunk texting?
 
19
A human evaluation
We asked three 
human annotators 
to predict
drunk texts on a held-out dataset.
Humans do it with an accuracy of 68.8%, our
(automatic) classifiers do the same with 64%
accuracy!
20
Conclusion
Our drunk prediction system obtains a best
accuracy of 
78.1
%.
While human annotators achieve an accuracy
of 
68.8
%, our system reaches 
64
%.
We, thus, make a case for drunk-texting
prediction as a useful and feasible NLP
application.
Refer the paper for a detailed description of drunk-texting
prediction, and error analysis of our results
For dataset and other questions, please contact: adityaj@cse.iitb.ac.in
21
Computational Sarcasm
Aditya Joshi
First presented at ACL 2015, Beijing, 2015, and WASSA at
EMNLP 2015, Lisbon, 2015
22
Motivation (1/3)
Sarcasm is popular on social media like twitter
Source; Hashtags.org
23
Motivation (2/3)
Sarcasm understanding is necessary for a successful Turing
Test
Human: “You are fast, just like a snail”
----------------------
ALICE: “Thank you for telling me I am fast like a snail”
Assistant.ai: “A good assistant is whatever their boss needs
them to be”
Human: “You are slow, just like a snail”
------------------
ALICE: “There is a lot of network traffic right now”
Assistant.ai: “A good assistant is whatever their boss needs them
to be”
24
Motivation (3/3)
Sarcasm detection is a challenge to existing sentiment analysis
systems
Linguistic Perspective
Computational Perspective
25
Is sarcasm really a challenge?: Linguistic
perspective
Four types 
Camp (2012)
Propositional
: 
 “Your shirt would totally suit a 5 year old.”
Lexical
: 
“Being stranded in traffic on a Monday morning is the 
best
 way to
start the week.”
Like-prefixed
: 
“As if that’s a good idea!”
Illocutionary
: 
“Thanks for holding the door” (when someone did not)
Context: 5 year olds generally have typical shirts.
Literal Proposition: Your shirt would totally suit a 5 year old.
Intended Proposition: Your shirt does not suit you.
Context: People do not generally like to get stranded in traffic.
Literal Proposition: Being stranded in traffic on Monday is the best way....
Intended Proposition: Being stranded in traffic on Monday is the worst way....
26
Is sarcasm really a challenge?:
Computational perspective
Precision of a sentiment classifier for sarcastic sentences i.e. % of sarcastic
sentences correctly labeled as negative
Bouazizi et al (2015) observe an improvement of 4% in sentiment analysis when
sarcasm classification was performed as a prior step.
27
What is computational sarcasm?
Computational sarcasm refers to computational
techniques pertaining to sarcasm
Goal: 
To use computational techniques to:
1.
Understand the phenomenon in humans
2.
Detect sarcasm
3.
Generate sarcasm
28
Literature Survey in sarcasm detection
 
29
Goal
The relationship between context incongruity
and sarcasm has been studied in linguistics.
We present a statistical system that harnesses
context incongruity as a basis for sarcasm
detection in the form of 
two kinds of
incongruity features: explicit and implicit
.
30
Context Incongruity
Incongruity is defined as 
‘the state of being
not in agreement, as with principles’.
Ivanko and Pexman (2003) state that the
sarcasm processing time (time taken by
humans to understand sarcasm) depends on
the 
degree of context incongruity 
between
the statement and the context.
31
Two ‘degrees’ 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’
32
Feature Set
 
(Based on Riloff et al (2013) )
(Based on Ramteke et al (2013) )
33
Datasets
34
Results
 
Tweet-A
Tweet-B
Discussion-A
35
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’.
Precision rises to 0.705 but the recall falls to
0.274.
Possible reason: Features become sparse since only
15% posts have elicitor posts
36
There may not always be ‘incongruity’
in the target tweet!
How we do it?
A tweet is sarcastic if:
1. There is contrast in
 target tweet
2. There is incompatibility between sentiment
in this tweet, and towards 
historical tweets
in the past that contain the entity in the
target tweet
Architecture
Contrast of sentiments in the same tweet is a
very strong indication of sarcasm.
Explicit - When words from wordlist with
opposite sentiment are present in the same
target tweet, then we mark it as sarcastic. 
Implicit -
We find these phrases by the
bootstrap algorithm described in Tsur et al.
(2010) Davidov et al.(2010) (based on
sentiment hashtags in tweets and commonly
occurring phrases)
Contrast Based Predictor
Historical Tweets
We run POS- tagger on target tweet.
Get tweets from user’s timeline which have
NNP sequence as in the target tweet.
These tweets are termed Historical tweets.
This way our approach extends the past work
by considering sentiment contrasts beyond the
target tweet.
Historical text is taken as the users view about
the subject (NNP). Why only NNP?
Sentiment of all the historical tweets in
averaged to get the users views.
Sentiment is calculated using a simple rule-
based engine that looks up lexicon and rules
for negation and conjunctions
If the target tweet sentiment is in contrast to
the historical sentiment then target tweet is
classified as sarcastic else non- sarcastic.
Historical Tweet Based Predictor
Integrator
We combine the results of our prediction of tweets as
sarcastic and non-sarcastic from the contrast based
predictor and historical tweet based predictor in three
ways :-
1. OR – A tweet is sarcastic if predicted as sarcastic by
at least one 
   
     predictor.
2, AND – A tweet is sarcastic if predicted as sarcastic by
both the  
   
     predictors.
3. Relaxed AND – A tweet is sarcastic if predicted as
sarcastic by both or if the historical tweets are not
found then the result of contrast based predictor is
considered.
Experimental Setup
Test tweets  from  Riloff et al. (2013):  total tweets ,
506- Sarcastic tweets, 1771 - non-sarcastic tweets.
For contrast-based predictor: Extracted from 8000
‘#sarcastic’ tweets.  442 phrases with implicit
negative sentiment (no implicit  positive sentiment
phrases because we extracted phrases from
sarcastic tweets
For historical sentiment-based predictor: Wordlists
from Pang et al (2004) and Mohammad et al (2013)
Results (1/2)
Using Pang and Lee (2004) wordlist
Results (2/2)
Using Mohammad and Turney (2013) wordlist
Discussion
(1/2)
 
As the target phrases in our approach are NNP sequence
we were able to predict sarcasm in the following
instances:-
Tweets addressed to other users. By historical tweets
we were able to find the relation between users and
therefore sarcasm.
Tweets referring to companies or organizations.
Ex. Target tweet - “because Fox’s is well-balanced and
objective
?
”.    Historical Tweet – “Fox’s World cup
streaming options are terrible.”
Informal words and expressions were tagged as NNPs
and thus from historical tweets we could extract the
sentiment associated with it and hence predict
sarcasm.
Discussion (2/2)
Limitation of our approach
:
The assumption that our historical tweet-
based predictor makes is that the author
has not been sarcastic about a target
phrase in the past.
 A twitter timeline may be private or
twitter handle name was changed or
account was deactivated.
Conclusion
We present a sarcasm detection approach based
on a linguistic theory: context incongruity
Our features perform 5% over a baseline of
unigrams for tweets, and 8% for discussion forum
posts.
We also outperform two past works substantially.
We introduce the concept of
 ‘looking beyond
target text’ 
for sarcasm detection using inter-
sentential incongruity. 
This promises to be an
exciting future work!
49
Slide Note
Embed
Share

Drunk-texting and sarcasm are explored through text analytics in a collaborative research project by Aditya Joshi and team. The study delves into predicting drunk-texting behavior and identifying sarcasm in text. Additionally, the content covers the continuous learning process of humans, child language acquisition, and machine learning definitions.

  • Text Analytics
  • Drunk-texting
  • Sarcasm Prediction
  • Machine Learning
  • Language Acquisition

Uploaded on Oct 11, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Applications of Text Analytics: Drunk-texting and Sarcasm Aditya Joshi IITB-Monash Research Academy Joint work with Abhijit Mishra, Vinita Sharma, Balamurali AR, Prof. Pushpak Bhattacharyya, Prof. Mark James Carman Contact email: adityaj@cse.iitb.ac.in 1

  2. Text Analytics Learning from text Outline for today: Introduction Drunk-texting prediction Sarcasm prediction 2

  3. Humans learn all the time We learn to drive a car We learn to cook Maggi We learn to speak How does a child learn language?

  4. The story of my year-old nephew According to a baby, the first meaning of their name is...?* The Kaka anecdote * : Child language Acquisition; Jean Piaget

  5. How did we learn things? The first time we turned a computer on A teacher told me exactly which switch to press, the first time. Later...? The first time I came to Wagholi (in 2012) Google maps or ...? The first time my father used Internet banking Step-by-step: one feature at a time Tell me exactly what to do: Programming I will do a task based on Similar tasks in the past: Learning! I will learn each time I do Something new: Online learning!

  6. Machine Learning: Definition A set of methods that can automatically detect patterns in data, and then use the uncovered patterns to predict future data, or to perform other kinds of decision making under uncertainty Predict whether a given piece of news is related to Sports, Politics or Bollywood Decide whether you want to cross the traffic Can machines do what humans do, seamlessly?

  7. Whose picture is this?

  8. Whose picture is this? A wombat A B

  9. Observed examples We recognize an animal, when we have seen one! The basic source of information for any machine learning application: Training instances Example: Text categorization The Leader of Opposition slammed the current policy of the Government. Australia won the Cricket World Cup in Melbourne this morning. Kangana Ranaut won the award for the Best Female Actor last week. Politics Sports Bollywood

  10. A typical ML pipeline A Training Data Machine learning algorithm machine that has learned

  11. Two types of learning Supervised learning Unsupervised learning Input: Labeled data set Input: Unlabeled data set e.g. Australia won the Cricket World Cup : Sports e.g. Set of Times of India Articles from 2011-2014 D: (x,y) x: data, y: label D: (x) y is a member of set of output labels

  12. Classification Predicting an output label, giving input data A cat classifier Is this a cat? Lesson 1: Training dataset 1) Identify your data 2) Identify your output labels Test example

  13. A Computational Approach to Automatic Prediction of Drunk-Texting Aditya Joshi First presented at ACL 2015, Beijing, 2015 13

  14. Goal Given a tweet, We wish to automatically identify if it was written under the influence of alcohol. Our work presents the first quantitative evidence that text contains signals that can be exploited to detect drunk-texting. 14

  15. Motivation Is this really useful? Alcohol abuse may lead to unsociable behaviour such as aggression (Bushman and Cooper, 1990), crime (Carpenter, 2007), suicide attempts (Merrill et al., 1992), drunk driving (Loomis and West, 1958), and risky sexual behaviour (Bryan et al., 2005) and privacy leaks. Applications: Investigation following an alcohol abuse incident NLP-based techniques to prevent regretful drunk-texting 15

  16. Methodology We use a set of n-gram and stylistic features in a SVM-based classifier 16

  17. Experiment Setup Obtaining labeled examples was a challenge. We use distant supervision using hashtags. Two datasets were created: Dataset 1 (2435 drunk, 762 sober): Tweets containing hashtags #drunk, etc, and those with #notdrunk, etc. Dataset 2 (2435 drunk, 5644 sober): The drunk tweets are downloaded using drunk hashtags, as above. Other tweets by same users are sober tweets. 17

  18. Results (1/2): Which features work best? 18

  19. Results (2/2): What are the top stylistic features for drunk texting? 19

  20. A human evaluation We asked three human annotators to predict drunk texts on a held-out dataset. Humans do it with an accuracy of 68.8%, our (automatic) classifiers do the same with 64% accuracy! 20

  21. Conclusion Our drunk prediction system obtains a best accuracy of 78.1%. While human annotators achieve an accuracy of 68.8%, our system reaches 64%. We, thus, make a case for drunk-texting prediction as a useful and feasible NLP application. Refer the paper for a detailed description of drunk-texting prediction, and error analysis of our results For dataset and other questions, please contact: adityaj@cse.iitb.ac.in 21

  22. Computational Sarcasm Aditya Joshi First presented at ACL 2015, Beijing, 2015, and WASSA at EMNLP 2015, Lisbon, 2015 22

  23. Motivation (1/3) Sarcasm is popular on social media like twitter Source; Hashtags.org 23

  24. Motivation (2/3) Sarcasm understanding is necessary for a successful Turing Test Human: You are slow, just like a snail ------------------ ALICE: There is a lot of network traffic right now Assistant.ai: A good assistant is whatever their boss needs them to be Human: You are fast, just like a snail ---------------------- ALICE: Thank you for telling me I am fast like a snail Assistant.ai: A good assistant is whatever their boss needs them to be 24

  25. Motivation (3/3) Sarcasm detection is a challenge to existing sentiment analysis systems Linguistic Perspective Computational Perspective 25

  26. Is sarcasm really a challenge?: Linguistic perspective Four types Camp (2012) Propositional: Your shirt would totally suit a 5 year old. Context: 5 year olds generally have typical shirts. Literal Proposition: Your shirt would totally suit a 5 year old. Intended Proposition: Your shirt does not suit you. Lexical: Being stranded in traffic on a Monday morning is the best way to start the week. Context: People do not generally like to get stranded in traffic. Literal Proposition: Being stranded in traffic on Monday is the best way.... Intended Proposition: Being stranded in traffic on Monday is the worst way.... Like-prefixed: As if that s a good idea! Illocutionary: Thanks for holding the door (when someone did not) 26

  27. Is sarcasm really a challenge?: Computational perspective Approach Precision (%) Dialogues (283 sarcastic sentences) MeaningCloud 20.14 NLTK 38.86 Tweets by Riloff et al (2013) (506 sarcastic tweets) MeaningCloud 17.58 NLTK 35.17 Precision of a sentiment classifier for sarcastic sentences i.e. % of sarcastic sentences correctly labeled as negative Bouazizi et al (2015) observe an improvement of 4% in sentiment analysis when sarcasm classification was performed as a prior step. 27

  28. What is computational sarcasm? Computational sarcasm refers to computational techniques pertaining to sarcasm Goal: To use computational techniques to: 1. Understand the phenomenon in humans 2. Detect sarcasm 3. Generate sarcasm 28

  29. Literature Survey in sarcasm detection 29

  30. Goal The relationship between context incongruity and sarcasm has been studied in linguistics. We present a statistical system that harnesses context incongruity as a basis for sarcasm detection in the form of two kinds of incongruity features: explicit and implicit. 30

  31. Context Incongruity Incongruity is defined as the state of being not in agreement, as with principles . Ivanko and Pexman (2003) state that the sarcasm processing time (time taken by humans to understand sarcasm) depends on the degree of context incongruity between the statement and the context. 31

  32. Two degrees 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 32

  33. Feature Set (Based on Riloff et al (2013) ) (Based on Ramteke et al (2013) ) 33

  34. Datasets Name Text-form Method of labeling Statistics Tweets Using sarcasm- based hashtags as labels 5208 total, 4170 sarcastic Tweet-A Tweets Manually labeled (Given by Riloff et al(2013)) 2278 total, 506 sarcastic Tweet-B Discussion forum posts (IAC Corpus) Manually labeled (Given by Walker et al (2012)) 1502 total, 752 sarcastic Discussion-A 34

  35. Results Tweet-B Tweet-A Discussion-A 35

  36. 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 . Precision rises to 0.705 but the recall falls to 0.274. Possible reason: Features become sparse since only 15% posts have elicitor posts 36

  37. There may not always be incongruity in the target tweet!

  38. How we do it? A tweet is sarcastic if: 1. There is contrast in target tweet 2. There is incompatibility between sentiment in this tweet, and towards historical tweets in the past that contain the entity in the target tweet

  39. Architecture

  40. Contrast Based Predictor Contrast of sentiments in the same tweet is a very strong indication of sarcasm. Explicit - When words from wordlist with opposite sentiment are present in the same target tweet, then we mark it as sarcastic. Implicit -We find these phrases by the bootstrap algorithm described in Tsur et al. (2010) Davidov et al.(2010) (based on sentiment hashtags in tweets and commonly occurring phrases)

  41. Historical Tweets We run POS- tagger on target tweet. Get tweets from user s timeline which have NNP sequence as in the target tweet. These tweets are termed Historical tweets. This way our approach extends the past work by considering sentiment contrasts beyond the target tweet.

  42. Historical Tweet Based Predictor Historical text is taken as the users view about the subject (NNP). Why only NNP? Sentiment of all the historical tweets in averaged to get the users views. Sentiment is calculated using a simple rule- based engine that looks up lexicon and rules for negation and conjunctions If the target tweet sentiment is in contrast to the historical sentiment then target tweet is classified as sarcastic else non- sarcastic.

  43. Integrator We combine the results of our prediction of tweets as sarcastic and non-sarcastic from the contrast based predictor and historical tweet based predictor in three ways :- 1. OR A tweet is sarcastic if predicted as sarcastic by at least one 2, AND A tweet is sarcastic if predicted as sarcastic by both the predictors. 3. Relaxed AND A tweet is sarcastic if predicted as sarcastic by both or if the historical tweets are not found then the result of contrast based predictor is considered. predictor.

  44. Experimental Setup Test tweets from Riloff et al. (2013): total tweets , 506- Sarcastic tweets, 1771 - non-sarcastic tweets. For contrast-based predictor: Extracted from 8000 #sarcastic tweets. 442 phrases with implicit negative sentiment (no implicit positive sentiment phrases because we extracted phrases from sarcastic tweets For historical sentiment-based predictor: Wordlists from Pang et al (2004) and Mohammad et al (2013)

  45. Results (1/2) Using Pang and Lee (2004) wordlist Precision Recall F- Score Best Reported value by Riloff et al(2013) 0.62 0.44 0.51 Only Historical Tweet- based 0.498 0.499 0.498 OR 0.791 0.8315 0.811 AND 0.756 0.521 0.617 Relaxed AND 0.8435 0.81 0.826

  46. Results (2/2) Using Mohammad and Turney (2013) wordlist Precision Recall F- Score Best Reported value by Riloff et al(2013) 0.62 0.44 0.51 Only Historical Tweet- based 0.496 0.499 0.497 OR 0.842 0.927 0.882 AND 0.779 0.524 0.627 Relaxed AND 0.880 0.884 0.882

  47. Discussion (1/2) As the target phrases in our approach are NNP sequence we were able to predict sarcasm in the following instances:- Tweets addressed to other users. By historical tweets we were able to find the relation between users and therefore sarcasm. Tweets referring to companies or organizations. Ex. Target tweet - because Fox s is well-balanced and objective? . Historical Tweet Fox s World cup streaming options are terrible. Informal words and expressions were tagged as NNPs and thus from historical tweets we could extract the sentiment associated with it and hence predict sarcasm.

  48. Discussion (2/2) Limitation of our approach: The assumption that our historical tweet- based predictor makes is that the author has not been sarcastic about a target phrase in the past. A twitter timeline may be private or twitter handle name was changed or account was deactivated.

  49. Conclusion We present a sarcasm detection approach based on a linguistic theory: context incongruity Our features perform 5% over a baseline of unigrams for tweets, and 8% for discussion forum posts. We also outperform two past works substantially. We introduce the concept of looking beyond target text for sarcasm detection using inter- sentential incongruity. This promises to be an exciting future work! 49

Related


More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#