How do we teach computers sarcasm, something which due to its complexity and contextual nuances sometimes leaves us humans puzzled? One way of studying sarcasm is through text, which at first would seem tricky for the computer as we don’t have access to speech-related information that usually help humans such as voice intonation style and visual emotional cues. In the past five years, researchers have found ways to teach computers to recognise sarcasm in text with an accuracy of up to 85%. Let’s look at how we got to this point:
Earlier research introduced linguistic markers as playing a part in patterning the nature of sarcastic texts online. This 2010 study by Tsur et al., identified linguistic cues of sarcasm from a dataset of Amazon online product reviews and such as excessive use of capital letters, use of sentiment words (‘yay!’, ‘great!’) within certain syntactic environments. The authors however stressed the difficulty of the computer to detect sarcasm in text, by which these cues may serve to convey other emotions such as anger within a written environment. Therefore these cues did not significantly reach high precision and recall.
Besides solely looking at the often explicit instances of sarcasm under the Twitter hashtag #sarcasm, researchers such as Bamman and Smith have tried to find a way to detect sarcasm in user’s tweets. Their study aimed to include a wider set of contextual factors that may play a part in correctly identifying this: author features, environment features and audience features. As shown in their table below, author features (which includes author’s historical salient terms and author’s historical salient topics in their tweets) showed the greatest increase in accuracy on top of tweet features. However a combination of all features over the tweet alone showed a significant improvement, to which the authors interpret as having to do with the interaction of author and audience – a type of sarcasm that relies on ‘common ground’. Bamman and Smith distinguish this from the #sarcasm hashtag that they say its explicit nature serves to make sarcasm known to a less-mutual audience.
The importance of detecting sarcasm is elucidated in instances where we want to teach the computer to detect another emotion. Just like how Tsur et al. emphasised how sarcasm may be confused with anger if we just look at those specific linguistic markers mentioned, how do we teach the computer to detect happiness without that sarcastic kind of happiness?
Dodds, Danforth and the team at the Computational Story Lab are seeking to do just that by measuring the average happiness of Twitter at hedonometer.org.
In this instance it appears challenging to detect if a highly-rated happy word such as ‘love’ is used literally or with a sarcastic tone. It would be interesting to see author features, as those in Bamman and Smith’s study, included in the analysis to see a shift in user tone and terms in helping detecting sarcasm, as suggested by Dodds himself in an episode of Lexicon Valley.
A deeper understanding on how we can teach sarcasm to computers would be beneficial for dialogue systems, marketing applications and artificial intelligence. Understanding sarcasm would also help to crystallise our knowledge of the more salient emotions. Let’s just hope the computers don’t get too snarky.