Can Tisane detect sarcasm?


Yeah, nah.

This question started popping right after the bloggers got tired of “can it handle idioms like ‘rain cats and dogs’” and “but does it work with ‘time flies like an arrow, fruit flies like a banana’”.

A better question is, “can sarcasm be detected from an utterance alone?” In brief, while some sarcasm can be detected linguistically, most instances of sarcasm rely on expert knowledge, such as knowledge about a situation or/and the mindset of the originator of the utterance (some people are always serious, others are never serious…).

YouTube video: best parts of The Room

A simple example: a sports team loses, and someone posts on their Facebook page, “great game!”, or, a comment to a video from the infamous “Citizen Kane of bad movies”, The Room, says, “incredible acting”; it’s clearly sarcasm, but will you know it from the utterance alone? No.

If we were to generalise what sarcasm is on a conceptual level, it is generally a juxtaposition of positivity and negativity. Sometimes, both are present in the utterance (“how are you?” “My house burned down, my family died, otherwise, I’m good.” or the more trivial cases like “Yeah, right”). More often, the negative is omitted from the utterance. (If it is mentioned explicitly, it is often not as funny.)

A great Stackoverflow discussion explains why it’s the case.

You may have heard of some studies and experiments to detect sarcasm with machine learning. These experiments merely use similarity to existing patterns, which may be able to sniff out something very similar, but is not generalised and hence can’t be used in real-world applications.

It is, however, possible to detect sarcasm in a dialogue by looking at the conversation in general:

  • the originator starts with what appears to be a very positive sentiment
  • the responses are negative and many

On the practical level, sarcasm is relatively rare when an utterance is disseminated to broad audience. In the business of detecting abuse, it’s simply irrelevant. Go on, look it up in your favourite stream of social media.

(Back in the day some people were saying that machine translation software is useless because it can’t translate Shakespeare flawlessly. The response was that it’s the same as claiming that industrial robots are useless because they can’t dance Swan Lake.)

If you’re shopping around for an NLP service / component, and a vendor claims the ability to detect sarcasm, it’s a huge red flag. We recommend additional scrutiny and asking them about how they can handle examples with missing information like those cited above. No, machine learning (at least the variety not involving Harry Potter and a magic wand) does not make up for missing info.

Bonus. Apparently, autistic people have more issues detecting sarcasm, and this fascinating post in Quora discusses possible reasons behind that.