SlideShare a Scribd company logo
Sarcasm And Thwarting
Lekha
Deepali Gupta
Sagar Ahire
{lekha, gdeepali, sagarahire} @ cse.iitb.ac.in
Roadmap
Irony and Sarcasm
An Algorithm for Sarcasm Detection
Thwarting Detection
Irony and Sarcasm
Lekha | 133050002
Verbal Irony
“An irony is a figure of speech which implicitly
displays that the utterance situation was surrounded
by an ironic environment.”

There also exists Situational Irony
Ironic Environment
Expectation

Expectation fails

t0

t1
Negative emotional
attitude of the speaker
Reasons for Expectation to Fail
Expectation E is caused by an action A
1. E failed because A failed or cannot be
performed because of another action B
2. E failed because A was not performed
Expectation E is not caused by any action
3. E failed by an action B
4. E accidentally failed

Type 1 and 3
have victims
Sarcasm is
irony with
definite victims
and
counterfeited
emotions
Properties of an Ironic Environment
An utterance implicitly displays all the three conditions for
ironic environment when it:
1. Alludes to the speaker's expectation E
2. Intentionally violates one of pragmatic principles
3. Implies the speaker's emotional attitude toward the
failure of E
Irony is recognized if any 2 of these 3 are recognized.
Irony conveys the third unidentified property.
Allude to Speaker’s Expectation
Deepali baked a pizza to satisfy her hunger. She placed the pizza on the
table and in the meantime Sagar came and gobbled up the whole pizza.
Deepali said to Sagar:
a. I'm not hungry at all
b. Have you seen my pizza on the table?
c. I'll sleep well on a full stomach.
d. I'm really satisfied to eat the pizza.
e. Did you enjoy eating the pizza?
Violation of Pragmatic Principles
Sincerity
You make a statement you believe
You ask a question whose answer you don’t know
You offer advice which will benefit the receiver
You thank when you are really grateful
Propositional content
You thank for something that has been done for you
Preparatory condition for Offer
You offer something that you can really give
Maxim of relevance
Politeness principle
Maxim of quantity
Emotional Attitude
Tone and expressions
Interjections “Oh! The weather is so nice”
The context implies the emotional attitude of
the speaker
Semi Supervised
Recognition of Sarcastic
Sentences
Deepali Gupta | 13305R001
Sarcasm
The activity of saying or writing the opposite of
what you mean, or of speaking in a way
intended to make someone feel stupid or show
that you are angry (Macmillan English
Dictionary)
Sarcasm manifests in other ways...
● “Love the cover” (book)
● “Be sure to save your purchase receipt”
(Smart Phone)
● “Great idea, now try again with a real
product development team” (e-reader)
● “Where am I?” (GPS device)
The Algorithm: Overview
1. Training Set: Sentences manually assigned
scores 1 to 5 where five means clearly
sarcastic and one absence of sarcasm
2. Create feature vectors from the labelled
sentences
3. Use these feature vectors to build a model
and assign scores to unlabelled examples
Step 1: Preprocessing of Data
1. Replace each appearance of a
product/company/author by generalized
[product], [company], [author], etc.
2. Remove all HTML tags and special symbols
from review text.
Step 2: Creating Feature Vectors
Pattern Based Features:
1. Classify words into High Frequency Words (HFWs) and
Content Words (CWs)
All [product], [company] tags and punctuation marks are
HFWs.
2. A pattern is a sequence of HFWs with slots for CWs.
Example: “Garmin does not care about product quality or
customer support” has patterns “[company] does not CW
about CW CW” or “about CW CW or CW CW”, etc.
Pattern Matching
1: Exact Match
: Sparse Match - additional non-matching words can
be inserted between pattern components

: Incomplete Match - only n of N pattern
components appear in sentence, while some
non-matching words can be inserted in
between
Punctuation Based Features
●
●
●
●
●

Sentence length in words
Number of “!” characters
Number of “?” characters
Number of quotes
Number of capitalized/all capital words

Features are normalized to be in [0-1] by dividing them by
maximal observed value
Step 3: Data Enrichment
● For each sentence in the training set perform
a search engine query containing this
sentence
● Assign similar label to newly extracted
sentence.
Step 4: Classification
● Construct feature vectors for each sentence in the
training and test set
● Compute Euclidean Distance to each of matching
vectors in training set
Let ti i=1..k be the k vectors with lowest Euclidean Distance to v.
Then v is classified label l as follows:
Count(l) = Count of vectors in the training set with label l
Label(v) =
Star Sentiment Baseline
● From a set of negative reviews (with 1-3
stars) classify those sentences as sarcastic
with strong positive sentiment.
● Positive sentiment words can be eg. “great”,
“best”, “top”, etc.
Results

0.256

0.312

0.821

0.281

patterns

0.743

0.788

0.943

0.765

pat+punct

0.868

0.763

0.945

0.812

enrich punct 0.4

0.390

0.832

0.395

enrich pat

0.762

0.777

0.937

0.769

all: SASI

Table 2 (Below):
Comparison with
baseline

Accuracy F-Score

punctuation

Table 1:(Above): 5-fold
cross validation results

Precision Recall

0.912

0.756

0.947

0.827

Precisio Recall
n

False
Pos

False
Neg

F-score

Baseline 0.5

0.16

0.05

0.44

0.242

SASI

0.813

0.11

0.12

0.788

0.766
Thwarting Detection
Sagar Ahire | 133050073
Thwarting?
“The actors were good, the story was great, the
screenplay was a marvel of perfection and the
music was good too, but the movie couldn’t
hold my attention...”
Detecting Thwarting: The Big Picture
● Ascertain attributes of entity using ontology
● Find sentiment of each attribute in ontology
and the overall entity
● If there is a contrast, conclude thwarting has
occured
Building the Domain Ontology
1. Identify key features of domain from a
corpus
2. Arrange them in a hierarchy
Notes:
● Very human-intensive
● One-time requirement
An Example Ontology
Movie

Story Elements

Main Story

Dialogues

Acting

Characters

Music

Songs

Background
Score
Approaches to Detect Thwarting
● Rule-based Approach
● Machine Learning-based Approach
Rule-based Approach
1. Get dependency parse for adjective-noun
dependencies
2. Identify polarities towards all nouns
3. Tag corresponding ontology nodes with
found polarities
4. If a contradiction across levels is found,
conclude that thwarting has taken place
Rule-based Approach: Example
Movie
negative

Story Elements
positive

Main Story
positive

Dialogues
positive

Acting
positive

Characters
positive

Music
positive

Songs
positive

Background
Score
negative
Machine Learning-based Approach
Proceeds in two phases:
1. Learning weights
2. Classifying documents
Learning Weights: Choices
1. Choices for loss function:
a. Linear loss
b. Hinge loss

2. Choices for percolation across ontology
levels:
a. Complete percolation
b. Controlled percolation
Classification: Features
● Convert document into a feature vector.
● Examples:
○
○
○
○
○

Document polarity
No of flips of sign
Longest contiguous subsequence of +ve values
Longest contiguous subsequence of -ve values
etc.
Results
● Random baseline: 50%
● Rule-based approach: 56.3%
● ML-based approach (Linear loss, controlled
percolation): 81%
What’s the catch?
Requires sentiment as input!
Document with
Sentiment Information

Document

Thwarted or Not Thwarted
Current System

Thwarted or Not Thwarted,
Document Sentiment
Ideal System
Key Ideas
● Irony indicates presence of an ironic environment,
with 3 properties
● 2 of those 3 are enough to recognize irony
● Sarcasm is irony with victims and counterfeited
emotions
● A semi supervised pattern based algorithm detects
sarcasm well
● Thwarting is the phenomenon of polarity reversal at
a higher level of ontology compared to the polarity
expressed at the lower level
● Rule based and machine learning based
approaches have been attempted for thwarting
References
● Akira Utsumi (1996) - A unified theory of irony and its
computational formalization. InCOLING, 962–967.
● Oren Tsur, Dmitry Davidov, Ari Rappoport (2010) ICWSM – A Great Catchy Name: Semi-Supervised
Recognition of Sarcastic Sentences in Online Product
Reviews. In Association for the advancement of Artificial
Intelligence
● Ankit Ramteke, Akshat Malu, Pushpak Bhattacharyya,
J. Saketha Nath (2013) - Detecting Turnarounds in
Sentiment Analysis: Thwarting. In ACL 2013.
Questions?

More Related Content

What's hot

Sarcasm Detection: Achilles Heel of sentiment analysis
Sarcasm Detection: Achilles Heel of sentiment analysisSarcasm Detection: Achilles Heel of sentiment analysis
Sarcasm Detection: Achilles Heel of sentiment analysis
Anuj Gupta
 
Testing grammar and vocabulary
Testing grammar and vocabularyTesting grammar and vocabulary
Testing grammar and vocabulary
marinasr_
 
Testing Grammar
Testing GrammarTesting Grammar
Testing GrammarMyno Uddin
 
NLP Asignment Final Presentation [IIT-Bombay]
NLP Asignment Final Presentation [IIT-Bombay]NLP Asignment Final Presentation [IIT-Bombay]
NLP Asignment Final Presentation [IIT-Bombay]
Sagar Ahire
 
Ire project presentation
Ire project presentationIre project presentation
Ire project presentation
Akshita Jha
 
Emotion mining in text
Emotion mining in textEmotion mining in text
Emotion mining in text
Lovepreet Singh
 
Testing grammar
Testing grammarTesting grammar
Testing grammar
Samcruz5
 
detect emotion from text
detect emotion from textdetect emotion from text
detect emotion from text
Safayet Hossain
 
Do you Mean what you say? Recognizing Emotions.
Do you Mean what you say? Recognizing Emotions.Do you Mean what you say? Recognizing Emotions.
Do you Mean what you say? Recognizing Emotions.
Sunil Kumar Kopparapu
 
Test techniques and testing overall ability
Test techniques and testing overall abilityTest techniques and testing overall ability
Test techniques and testing overall ability
Santi Setiorini Nur
 
SentiCircles for Contextual and Conceptual Semantic Sentiment Analysis of Twi...
SentiCircles for Contextual and Conceptual Semantic Sentiment Analysis of Twi...SentiCircles for Contextual and Conceptual Semantic Sentiment Analysis of Twi...
SentiCircles for Contextual and Conceptual Semantic Sentiment Analysis of Twi...
Knowledge Media Institute - The Open University
 
Testing listening (1)
Testing listening (1)Testing listening (1)
Testing listening (1)
Maury Martinez
 
Assessing grammar
Assessing grammarAssessing grammar
Assessing grammar
Aisah Aish
 
Deep Learning for Natural Language Processing
Deep Learning for Natural Language ProcessingDeep Learning for Natural Language Processing
Deep Learning for Natural Language Processing
ParrotAI
 
Sentiment Analysis
Sentiment AnalysisSentiment Analysis
Sentiment Analysis
Sagar Ahire
 
Absa project
Absa projectAbsa project
Absa project
Indranil Mukherjee
 

What's hot (17)

Sarcasm Detection: Achilles Heel of sentiment analysis
Sarcasm Detection: Achilles Heel of sentiment analysisSarcasm Detection: Achilles Heel of sentiment analysis
Sarcasm Detection: Achilles Heel of sentiment analysis
 
Testing grammar and vocabulary
Testing grammar and vocabularyTesting grammar and vocabulary
Testing grammar and vocabulary
 
Testing Grammar
Testing GrammarTesting Grammar
Testing Grammar
 
NLP Asignment Final Presentation [IIT-Bombay]
NLP Asignment Final Presentation [IIT-Bombay]NLP Asignment Final Presentation [IIT-Bombay]
NLP Asignment Final Presentation [IIT-Bombay]
 
Ire project presentation
Ire project presentationIre project presentation
Ire project presentation
 
Emotion mining in text
Emotion mining in textEmotion mining in text
Emotion mining in text
 
Testing grammar
Testing grammarTesting grammar
Testing grammar
 
detect emotion from text
detect emotion from textdetect emotion from text
detect emotion from text
 
Do you Mean what you say? Recognizing Emotions.
Do you Mean what you say? Recognizing Emotions.Do you Mean what you say? Recognizing Emotions.
Do you Mean what you say? Recognizing Emotions.
 
Testing vocabulary
Testing vocabularyTesting vocabulary
Testing vocabulary
 
Test techniques and testing overall ability
Test techniques and testing overall abilityTest techniques and testing overall ability
Test techniques and testing overall ability
 
SentiCircles for Contextual and Conceptual Semantic Sentiment Analysis of Twi...
SentiCircles for Contextual and Conceptual Semantic Sentiment Analysis of Twi...SentiCircles for Contextual and Conceptual Semantic Sentiment Analysis of Twi...
SentiCircles for Contextual and Conceptual Semantic Sentiment Analysis of Twi...
 
Testing listening (1)
Testing listening (1)Testing listening (1)
Testing listening (1)
 
Assessing grammar
Assessing grammarAssessing grammar
Assessing grammar
 
Deep Learning for Natural Language Processing
Deep Learning for Natural Language ProcessingDeep Learning for Natural Language Processing
Deep Learning for Natural Language Processing
 
Sentiment Analysis
Sentiment AnalysisSentiment Analysis
Sentiment Analysis
 
Absa project
Absa projectAbsa project
Absa project
 

Viewers also liked

Detecting Sarcasm in Multimodal Social Platforms
Detecting Sarcasm in Multimodal Social PlatformsDetecting Sarcasm in Multimodal Social Platforms
Detecting Sarcasm in Multimodal Social Platforms
Rossano Schifanella
 
Paolo Rosso "On irony detection in social media"
Paolo Rosso "On irony detection in social media"Paolo Rosso "On irony detection in social media"
Paolo Rosso "On irony detection in social media"
AINL Conferences
 
Netflix presentation final
Netflix presentation   finalNetflix presentation   final
Netflix presentation final
George Roth
 
Feature specific analysis of reviews
Feature specific analysis of reviewsFeature specific analysis of reviews
Feature specific analysis of reviews
Subhabrata Mukherjee
 
Who cares about sarcastic tweets? Investigating the impact of sarcasm on sent...
Who cares about sarcastic tweets? Investigating the impact of sarcasm on sent...Who cares about sarcastic tweets? Investigating the impact of sarcasm on sent...
Who cares about sarcastic tweets? Investigating the impact of sarcasm on sent...
Diana Maynard
 
Python NLTK
Python NLTKPython NLTK
Python NLTK
Alberts Pumpurs
 
Text Analysis and Semantic Search with GATE
Text Analysis and Semantic Search with GATEText Analysis and Semantic Search with GATE
Text Analysis and Semantic Search with GATE
Diana Maynard
 
Sentiments Analysis using Python and nltk
Sentiments Analysis using Python and nltk Sentiments Analysis using Python and nltk
Sentiments Analysis using Python and nltk
Ashwin Perti
 
Ontology Mapping
Ontology MappingOntology Mapping
Ontology Mapping
samhati27
 
Document Summarization
Document SummarizationDocument Summarization
Document SummarizationPratik Kumar
 
Text analysis and Semantic Search with GATE
Text analysis and Semantic Search with GATEText analysis and Semantic Search with GATE
Text analysis and Semantic Search with GATE
Diana Maynard
 
Ontology Mapping
Ontology MappingOntology Mapping
Ontology Mappingbutest
 
Sentiment analysis-by-nltk
Sentiment analysis-by-nltkSentiment analysis-by-nltk
Sentiment analysis-by-nltkWei-Ting Kuo
 
MTech Seminar Presentation [IIT-Bombay]
MTech Seminar Presentation [IIT-Bombay]MTech Seminar Presentation [IIT-Bombay]
MTech Seminar Presentation [IIT-Bombay]
Sagar Ahire
 
Text Summarization
Text SummarizationText Summarization
Text Summarization
Carlos Castillo (ChaTo)
 
Tutorial on automatic summarization
Tutorial on automatic summarizationTutorial on automatic summarization
Tutorial on automatic summarization
Constantin Orasan
 
Introduction to Sentiment Analysis
Introduction to Sentiment AnalysisIntroduction to Sentiment Analysis
Introduction to Sentiment Analysis
Jaganadh Gopinadhan
 
Text summarization
Text summarizationText summarization
Text summarizationkareemhashem
 

Viewers also liked (20)

Detecting Sarcasm in Multimodal Social Platforms
Detecting Sarcasm in Multimodal Social PlatformsDetecting Sarcasm in Multimodal Social Platforms
Detecting Sarcasm in Multimodal Social Platforms
 
Paolo Rosso "On irony detection in social media"
Paolo Rosso "On irony detection in social media"Paolo Rosso "On irony detection in social media"
Paolo Rosso "On irony detection in social media"
 
Netflix presentation final
Netflix presentation   finalNetflix presentation   final
Netflix presentation final
 
sent_analysis_report
sent_analysis_reportsent_analysis_report
sent_analysis_report
 
Feature specific analysis of reviews
Feature specific analysis of reviewsFeature specific analysis of reviews
Feature specific analysis of reviews
 
Who cares about sarcastic tweets? Investigating the impact of sarcasm on sent...
Who cares about sarcastic tweets? Investigating the impact of sarcasm on sent...Who cares about sarcastic tweets? Investigating the impact of sarcasm on sent...
Who cares about sarcastic tweets? Investigating the impact of sarcasm on sent...
 
Python NLTK
Python NLTKPython NLTK
Python NLTK
 
Text Analysis and Semantic Search with GATE
Text Analysis and Semantic Search with GATEText Analysis and Semantic Search with GATE
Text Analysis and Semantic Search with GATE
 
Sentiments Analysis using Python and nltk
Sentiments Analysis using Python and nltk Sentiments Analysis using Python and nltk
Sentiments Analysis using Python and nltk
 
Ontology Mapping
Ontology MappingOntology Mapping
Ontology Mapping
 
Document Summarization
Document SummarizationDocument Summarization
Document Summarization
 
Text analysis and Semantic Search with GATE
Text analysis and Semantic Search with GATEText analysis and Semantic Search with GATE
Text analysis and Semantic Search with GATE
 
Ontology Mapping
Ontology MappingOntology Mapping
Ontology Mapping
 
Sentiment analysis-by-nltk
Sentiment analysis-by-nltkSentiment analysis-by-nltk
Sentiment analysis-by-nltk
 
MTech Seminar Presentation [IIT-Bombay]
MTech Seminar Presentation [IIT-Bombay]MTech Seminar Presentation [IIT-Bombay]
MTech Seminar Presentation [IIT-Bombay]
 
Text Summarization
Text SummarizationText Summarization
Text Summarization
 
Tutorial on automatic summarization
Tutorial on automatic summarizationTutorial on automatic summarization
Tutorial on automatic summarization
 
Introduction to Sentiment Analysis
Introduction to Sentiment AnalysisIntroduction to Sentiment Analysis
Introduction to Sentiment Analysis
 
Text summarization
Text summarizationText summarization
Text summarization
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 

Similar to Sarcasm & Thwarting in Sentiment Analysis [IIT-Bombay]

Improving students speaking skill through socio drama at
Improving students speaking skill through socio drama atImproving students speaking skill through socio drama at
Improving students speaking skill through socio drama atLily Andryani
 
NLP_KASHK:Evaluating Language Model
NLP_KASHK:Evaluating Language ModelNLP_KASHK:Evaluating Language Model
NLP_KASHK:Evaluating Language Model
Hemantha Kulathilake
 
Ilja state2014expressivity
Ilja state2014expressivityIlja state2014expressivity
Ilja state2014expressivitymaartenmarx
 
Intrinsic and Extrinsic Evaluations of Word Embeddings
Intrinsic and Extrinsic Evaluations of Word EmbeddingsIntrinsic and Extrinsic Evaluations of Word Embeddings
Intrinsic and Extrinsic Evaluations of Word Embeddings
Jinho Choi
 
sa-mincut-aditya.ppt
sa-mincut-aditya.pptsa-mincut-aditya.ppt
sa-mincut-aditya.ppt
aashnareddy1
 
HackYale - Natural Language Processing (Week 1)
HackYale - Natural Language Processing (Week 1)HackYale - Natural Language Processing (Week 1)
HackYale - Natural Language Processing (Week 1)
Nick Hathaway
 
NLP Bootcamp 2018 : Representation Learning of text for NLP
NLP Bootcamp 2018 : Representation Learning of text for NLPNLP Bootcamp 2018 : Representation Learning of text for NLP
NLP Bootcamp 2018 : Representation Learning of text for NLP
Anuj Gupta
 
Opinion mining
Opinion miningOpinion mining
Opinion mining
HEENA GUPTA
 
Pycon India 2018 Natural Language Processing Workshop
Pycon India 2018   Natural Language Processing WorkshopPycon India 2018   Natural Language Processing Workshop
Pycon India 2018 Natural Language Processing Workshop
Lakshya Sivaramakrishnan
 
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptxNLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
Boston Institute of Analytics
 
NLP Bootcamp
NLP BootcampNLP Bootcamp
NLP Bootcamp
Anuj Gupta
 
Measuring Up Core Success
Measuring Up Core SuccessMeasuring Up Core Success
Measuring Up Core Success
Mastery Education
 
English Language Exposition/ Expository Writing
English Language Exposition/ Expository WritingEnglish Language Exposition/ Expository Writing
English Language Exposition/ Expository Writing
Goh Bang Rui
 
Lundgren_Genre-based Pedagogy: Applying SFL to the Classroom
Lundgren_Genre-based Pedagogy: Applying SFL to the ClassroomLundgren_Genre-based Pedagogy: Applying SFL to the Classroom
Lundgren_Genre-based Pedagogy: Applying SFL to the Classroom
Minnesota English Learner Education Conference
 
Detecting, Measuring and Representing Vagueness in Ontologies
Detecting, Measuring and Representing Vagueness in OntologiesDetecting, Measuring and Representing Vagueness in Ontologies
Detecting, Measuring and Representing Vagueness in Ontologies
Panos Alexopoulos
 

Similar to Sarcasm & Thwarting in Sentiment Analysis [IIT-Bombay] (20)

Improving students speaking skill through socio drama at
Improving students speaking skill through socio drama atImproving students speaking skill through socio drama at
Improving students speaking skill through socio drama at
 
NLP_KASHK:Evaluating Language Model
NLP_KASHK:Evaluating Language ModelNLP_KASHK:Evaluating Language Model
NLP_KASHK:Evaluating Language Model
 
Ilja state2014expressivity
Ilja state2014expressivityIlja state2014expressivity
Ilja state2014expressivity
 
Intrinsic and Extrinsic Evaluations of Word Embeddings
Intrinsic and Extrinsic Evaluations of Word EmbeddingsIntrinsic and Extrinsic Evaluations of Word Embeddings
Intrinsic and Extrinsic Evaluations of Word Embeddings
 
sa-mincut-aditya.ppt
sa-mincut-aditya.pptsa-mincut-aditya.ppt
sa-mincut-aditya.ppt
 
sa-mincut-aditya.ppt
sa-mincut-aditya.pptsa-mincut-aditya.ppt
sa-mincut-aditya.ppt
 
sa.ppt
sa.pptsa.ppt
sa.ppt
 
HackYale - Natural Language Processing (Week 1)
HackYale - Natural Language Processing (Week 1)HackYale - Natural Language Processing (Week 1)
HackYale - Natural Language Processing (Week 1)
 
NLP Bootcamp 2018 : Representation Learning of text for NLP
NLP Bootcamp 2018 : Representation Learning of text for NLPNLP Bootcamp 2018 : Representation Learning of text for NLP
NLP Bootcamp 2018 : Representation Learning of text for NLP
 
Opinion mining
Opinion miningOpinion mining
Opinion mining
 
Pycon India 2018 Natural Language Processing Workshop
Pycon India 2018   Natural Language Processing WorkshopPycon India 2018   Natural Language Processing Workshop
Pycon India 2018 Natural Language Processing Workshop
 
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptxNLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
NLP Project PPT: Flipkart Product Reviews through NLP Data Science.pptx
 
NLP Bootcamp
NLP BootcampNLP Bootcamp
NLP Bootcamp
 
C5 giruba beulah
C5 giruba beulahC5 giruba beulah
C5 giruba beulah
 
Measuring Up Core Success
Measuring Up Core SuccessMeasuring Up Core Success
Measuring Up Core Success
 
Specs design
Specs designSpecs design
Specs design
 
English Language Exposition/ Expository Writing
English Language Exposition/ Expository WritingEnglish Language Exposition/ Expository Writing
English Language Exposition/ Expository Writing
 
AI Lesson 11
AI Lesson 11AI Lesson 11
AI Lesson 11
 
Lundgren_Genre-based Pedagogy: Applying SFL to the Classroom
Lundgren_Genre-based Pedagogy: Applying SFL to the ClassroomLundgren_Genre-based Pedagogy: Applying SFL to the Classroom
Lundgren_Genre-based Pedagogy: Applying SFL to the Classroom
 
Detecting, Measuring and Representing Vagueness in Ontologies
Detecting, Measuring and Representing Vagueness in OntologiesDetecting, Measuring and Representing Vagueness in Ontologies
Detecting, Measuring and Representing Vagueness in Ontologies
 

Recently uploaded

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 

Recently uploaded (20)

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 

Sarcasm & Thwarting in Sentiment Analysis [IIT-Bombay]

  • 1. Sarcasm And Thwarting Lekha Deepali Gupta Sagar Ahire {lekha, gdeepali, sagarahire} @ cse.iitb.ac.in
  • 2. Roadmap Irony and Sarcasm An Algorithm for Sarcasm Detection Thwarting Detection
  • 4. Verbal Irony “An irony is a figure of speech which implicitly displays that the utterance situation was surrounded by an ironic environment.” There also exists Situational Irony
  • 6. Reasons for Expectation to Fail Expectation E is caused by an action A 1. E failed because A failed or cannot be performed because of another action B 2. E failed because A was not performed Expectation E is not caused by any action 3. E failed by an action B 4. E accidentally failed Type 1 and 3 have victims Sarcasm is irony with definite victims and counterfeited emotions
  • 7. Properties of an Ironic Environment An utterance implicitly displays all the three conditions for ironic environment when it: 1. Alludes to the speaker's expectation E 2. Intentionally violates one of pragmatic principles 3. Implies the speaker's emotional attitude toward the failure of E Irony is recognized if any 2 of these 3 are recognized. Irony conveys the third unidentified property.
  • 8. Allude to Speaker’s Expectation Deepali baked a pizza to satisfy her hunger. She placed the pizza on the table and in the meantime Sagar came and gobbled up the whole pizza. Deepali said to Sagar: a. I'm not hungry at all b. Have you seen my pizza on the table? c. I'll sleep well on a full stomach. d. I'm really satisfied to eat the pizza. e. Did you enjoy eating the pizza?
  • 9. Violation of Pragmatic Principles Sincerity You make a statement you believe You ask a question whose answer you don’t know You offer advice which will benefit the receiver You thank when you are really grateful Propositional content You thank for something that has been done for you Preparatory condition for Offer You offer something that you can really give Maxim of relevance Politeness principle Maxim of quantity
  • 10. Emotional Attitude Tone and expressions Interjections “Oh! The weather is so nice” The context implies the emotional attitude of the speaker
  • 11. Semi Supervised Recognition of Sarcastic Sentences Deepali Gupta | 13305R001
  • 12. Sarcasm The activity of saying or writing the opposite of what you mean, or of speaking in a way intended to make someone feel stupid or show that you are angry (Macmillan English Dictionary)
  • 13. Sarcasm manifests in other ways... ● “Love the cover” (book) ● “Be sure to save your purchase receipt” (Smart Phone) ● “Great idea, now try again with a real product development team” (e-reader) ● “Where am I?” (GPS device)
  • 14. The Algorithm: Overview 1. Training Set: Sentences manually assigned scores 1 to 5 where five means clearly sarcastic and one absence of sarcasm 2. Create feature vectors from the labelled sentences 3. Use these feature vectors to build a model and assign scores to unlabelled examples
  • 15. Step 1: Preprocessing of Data 1. Replace each appearance of a product/company/author by generalized [product], [company], [author], etc. 2. Remove all HTML tags and special symbols from review text.
  • 16. Step 2: Creating Feature Vectors Pattern Based Features: 1. Classify words into High Frequency Words (HFWs) and Content Words (CWs) All [product], [company] tags and punctuation marks are HFWs. 2. A pattern is a sequence of HFWs with slots for CWs. Example: “Garmin does not care about product quality or customer support” has patterns “[company] does not CW about CW CW” or “about CW CW or CW CW”, etc.
  • 17. Pattern Matching 1: Exact Match : Sparse Match - additional non-matching words can be inserted between pattern components : Incomplete Match - only n of N pattern components appear in sentence, while some non-matching words can be inserted in between
  • 18. Punctuation Based Features ● ● ● ● ● Sentence length in words Number of “!” characters Number of “?” characters Number of quotes Number of capitalized/all capital words Features are normalized to be in [0-1] by dividing them by maximal observed value
  • 19. Step 3: Data Enrichment ● For each sentence in the training set perform a search engine query containing this sentence ● Assign similar label to newly extracted sentence.
  • 20. Step 4: Classification ● Construct feature vectors for each sentence in the training and test set ● Compute Euclidean Distance to each of matching vectors in training set Let ti i=1..k be the k vectors with lowest Euclidean Distance to v. Then v is classified label l as follows: Count(l) = Count of vectors in the training set with label l Label(v) =
  • 21. Star Sentiment Baseline ● From a set of negative reviews (with 1-3 stars) classify those sentences as sarcastic with strong positive sentiment. ● Positive sentiment words can be eg. “great”, “best”, “top”, etc.
  • 22. Results 0.256 0.312 0.821 0.281 patterns 0.743 0.788 0.943 0.765 pat+punct 0.868 0.763 0.945 0.812 enrich punct 0.4 0.390 0.832 0.395 enrich pat 0.762 0.777 0.937 0.769 all: SASI Table 2 (Below): Comparison with baseline Accuracy F-Score punctuation Table 1:(Above): 5-fold cross validation results Precision Recall 0.912 0.756 0.947 0.827 Precisio Recall n False Pos False Neg F-score Baseline 0.5 0.16 0.05 0.44 0.242 SASI 0.813 0.11 0.12 0.788 0.766
  • 24. Thwarting? “The actors were good, the story was great, the screenplay was a marvel of perfection and the music was good too, but the movie couldn’t hold my attention...”
  • 25. Detecting Thwarting: The Big Picture ● Ascertain attributes of entity using ontology ● Find sentiment of each attribute in ontology and the overall entity ● If there is a contrast, conclude thwarting has occured
  • 26. Building the Domain Ontology 1. Identify key features of domain from a corpus 2. Arrange them in a hierarchy Notes: ● Very human-intensive ● One-time requirement
  • 27. An Example Ontology Movie Story Elements Main Story Dialogues Acting Characters Music Songs Background Score
  • 28. Approaches to Detect Thwarting ● Rule-based Approach ● Machine Learning-based Approach
  • 29. Rule-based Approach 1. Get dependency parse for adjective-noun dependencies 2. Identify polarities towards all nouns 3. Tag corresponding ontology nodes with found polarities 4. If a contradiction across levels is found, conclude that thwarting has taken place
  • 30. Rule-based Approach: Example Movie negative Story Elements positive Main Story positive Dialogues positive Acting positive Characters positive Music positive Songs positive Background Score negative
  • 31. Machine Learning-based Approach Proceeds in two phases: 1. Learning weights 2. Classifying documents
  • 32. Learning Weights: Choices 1. Choices for loss function: a. Linear loss b. Hinge loss 2. Choices for percolation across ontology levels: a. Complete percolation b. Controlled percolation
  • 33. Classification: Features ● Convert document into a feature vector. ● Examples: ○ ○ ○ ○ ○ Document polarity No of flips of sign Longest contiguous subsequence of +ve values Longest contiguous subsequence of -ve values etc.
  • 34. Results ● Random baseline: 50% ● Rule-based approach: 56.3% ● ML-based approach (Linear loss, controlled percolation): 81%
  • 35. What’s the catch? Requires sentiment as input! Document with Sentiment Information Document Thwarted or Not Thwarted Current System Thwarted or Not Thwarted, Document Sentiment Ideal System
  • 36. Key Ideas ● Irony indicates presence of an ironic environment, with 3 properties ● 2 of those 3 are enough to recognize irony ● Sarcasm is irony with victims and counterfeited emotions ● A semi supervised pattern based algorithm detects sarcasm well ● Thwarting is the phenomenon of polarity reversal at a higher level of ontology compared to the polarity expressed at the lower level ● Rule based and machine learning based approaches have been attempted for thwarting
  • 37. References ● Akira Utsumi (1996) - A unified theory of irony and its computational formalization. InCOLING, 962–967. ● Oren Tsur, Dmitry Davidov, Ari Rappoport (2010) ICWSM – A Great Catchy Name: Semi-Supervised Recognition of Sarcastic Sentences in Online Product Reviews. In Association for the advancement of Artificial Intelligence ● Ankit Ramteke, Akshat Malu, Pushpak Bhattacharyya, J. Saketha Nath (2013) - Detecting Turnarounds in Sentiment Analysis: Thwarting. In ACL 2013.