Worksheet: Sarcasm and Irony Detection

When words don't mean what they say
Course: Natural Language Annotation for Machine Learning Task Type: Classification with pragmatic interpretation
Author: Jin Zhao

Background

Sarcasm and irony are forms of figurative language where the intended meaning differs from the literal meaning. Detecting these is crucial for sentiment analysis, content moderation, and conversational AI.

Sarcasm: Using irony to mock or convey contempt. Often involves saying the opposite of what one means.

Irony: A broader concept where reality differs from expectation, or words convey opposite meaning.

Why This is Hard

Part 1: Basic Sarcasm Recognition

Example 1
"Oh great, another meeting that could have been an email."
Example 2
"I love working weekends!"
Example 3
"What a beautiful day for a hike!"
Question 1

For Example 2 and 3, what additional information would you need to be certain?

Part 2: Context Dependence

Example 4a
"Nice job on the presentation."
Context: Said after colleague delivered an award-winning pitch
Example 4b
"Nice job on the presentation."
Context: Said after colleague forgot their slides and rambled for 30 minutes
Question 2

The same sentence has opposite meanings in different contexts. How should annotation handle this?

Part 3: Sarcasm Markers and Cues

Example 5
"Wow, what a BRILLIANT idea. I can't POSSIBLY imagine what could go wrong."
Example 6
"Sure, that plan will definitely work 🙄"
Question 3

What textual cues suggest sarcasm? (Check all that apply)

Part 4: Cultural and Platform Differences

Example 7 (Twitter/X)
"Day 47 of my diet. Still fat. This is fine."
Example 8 (Product Review)
"This vacuum cleaner is so good at collecting dust that it broke after one use. Highly recommend!"
Question 4

Does the platform/genre affect how you interpret sarcasm?

Part 5: Confidence Annotation

Example 9
"Thanks for the feedback. Really helpful."
Question 5

Label this example and rate your confidence:

Confidence level:

Part 6: Sentiment and Sarcasm Interaction

Question 6

Consider the review: "This product exceeded all my expectations. It fell apart after two days. Just what I was hoping for."

What is the sentiment?

Part 7: Group Discussion

Question 7

Compare your annotations with your group. Where did you disagree?

Part 8: Reflection

Question 8

Why is sarcasm detection one of the hardest NLP tasks?

Key Takeaway

Sarcasm annotation requires modeling speaker intent, not just text—and intent depends on context, culture, and relationship.

  • The same text can be sincere or sarcastic depending on context
  • Annotation guidelines must decide: literal meaning or intended meaning?
  • Confidence annotation may be as important as the label itself
  • Some texts are genuinely ambiguous—and that's useful information