16 Jun 2014

Can a Machine Really Detect Sarcasm?

Sarcasm is often described as ‘the lowest form of wit’ – but if this is the case, why do we sometimes have difficulty picking up on it?

The US Secret Service – the law enforcement organisation charged with the task of protecting Barack Obama – appears to be having a hard time recognising sarcasm online, and is turning to technology in a bid to find an answer.

Top dogs at the agency are currently looking to implement software that can help them work out whether posts on social media websites such as Twitter and Facebook are real threats or merely (ill-advised) jokes.

But are machines really capable of identifying sarcasm? Is technology the solution to the organisation’s dilemma?

Twitter Joke Trial

Twitter is touted as a place to express opinion and communicate with the world – but be careful what your 140-character post contains.

Back in January 2010 in the UK, expectant-traveller Paul Chambers was booked on a flight from Robin Hood Airport. But extreme cold weather across northern England meant several airports, including the South Yorkshire airport, were forced to cancel flights, leaving passengers stranded and unable to reach their destinations.

Upon hearing the news, Chambers took to Twitter to voice his anger. He posted: “Crap! Robin Hood airport is closed. You’ve got a week and a bit to get your shit together otherwise I’m blowing the airport sky high!!”

A week later, an off-duty manager at the airport found the message while doing an unrelated computer search. Although airport management considered the message to be “not credible” as a threat, they still forwarded it to the police who arrested Chambers on the suspicion that he planned to commit an act of terrorism.

He was later charged with “sending a public electronic message that was grossly offensive or of an indecent, obscene or menacing character contrary to the Communications Act 2003” – landing him a £385 fine. He also lost his job as a result.

The conviction was widely condemned as unfair, with a number of celebrities, including the likes of television presenter Stephen Fry and television writer Graham Linehan, calling for it to be overturned.

Many people claimed the joke had been lost in translation – and on the third appeal the conviction was eventually quashed.

But it went to show how sarcasm can be difficult to spot, especially when it comes to written text.

Sarcasm is generally easier to identify when talking to someone face-to-face as people are able to pick up on various vocal inflections or signs in the speaker’s body language. Even then, however, we can mistake a joke for intent.

Tweet about it and they will deliver

On a brighter note of misunderstood sarcasm, Peter Shankman, an investment guru travelling on a flight from Tampa in Florida to Newark in New Jersey, found that if you tweet about what you want, someone will often deliver it to you, even if it was only a joke.

He tweeted: “Hey @Mortons – can you meet me at newark airport with a porterhouse when I land in two hours? K, thanks. :)”

And to his surprise, they did just that! Waiting for him on arrival was a tuxedoed waiter from the restaurant and the requested cut of meat.

Shankman didn’t think he was actually ordering a meal when he posted the message, but this instance proves how humans can misinterpret sarcasm. So what chance does a machine have when it comes to sarcasm?

Getting a computer to detect sarcasm and its linguistic complexities has proved extremely difficult to date.

Companies have already tried to use algorithms that attempt to detect sarcasm online or over the telephone when measuring things such as customer satisfaction – yet the results have produced limited success.

So how far away is automatic sarcasm detection?

Automatic sarcasm detection is still in its infancy. One reason for the lack of computational models is the absence of accurately labelled, naturally occurring instances of sarcasm to train machine-learning systems.

The answer to the question is therefore probably not anytime soon. But the US Secret Service remains hopeful that there is a tech geek out there who can help them in their quest for a machine that can detect sarcasm.

The organisation’s desire for sarcasm detection software may stem from a number of threatening tweets sent to candidates during the 2012 presidential election.

There were millions of posts on Twitter about the election in the weeks before voting began, including some death threats to President Barack Obama and Republican candidate Mitt Romney, which lead to the arrests of two men.

Jarvis Britton, 26, from Birmingham, Alabama, was sentenced to one year in prison after he sent out a tweet that read: “free speech? Really? Let’s test this! Let’s kill the president!”

Meanwhile, Donte Jamar Sims, 22, from North Carolina, was sentenced to six months in prison after posting threatening tweets that said “Ima Assassinate president Obama this evening!” and “The Secret Service is gonna be defenseless once I aim the Assault Rifle at Barack’s Forehead.”

It is a felony to threaten a president in the United States – and doing so can be met with a fine and a maximum five-year prison sentence.

Had software that detects sarcasm been around when the men sent their tweets, the Secret Service may have instantly figured out a different set of intentions surrounding their posts, as well as the deeper meaning behind what they were saying.

Critics voice their concerns

The ability to detect sarcasm and false positives is just one of 16 or 18 things that the Secret Service is looking at.

But not everyone is convinced they will succeed in their efforts.

Technology experts, for instance, claim a sarcasm detector will never exist because computers can’t grasp the nuances of language.

Some are also worried about attempts to interpret speech by a government agency that has the power to arrest people for posting alleged threats online, while a significant number are concerned that such technology would signal the end of people’s ability to freely express themselves.


Sign up to our newsletter

Get our blog articles straight to your inbox.