MIT scientists have developed a new artificial intelligence system that can detect sarcasm in tweets better than humans, an advance that may help computers automatically spot and remove online hate speech and abusive comments.
Detecting the sentiment of social media posts can also track attitudes towards brands and products, and identify signals that might indicate trends in the financial markets.
A deeper understanding of Twitter may also help understand how information and influence flows through the network.
The researchers originally aimed to develop a system capable of detecting racist posts on Twitter.
However, the meaning of many messages could not be properly understood without some understanding of sarcasm.
The algorithm uses deep learning, a popular machine-learning technique that relies on training a very large simulated neural network to recognise subtle patterns using a large amount of data.
Researchers took advantage of emojis to help the algorithm identify and label emotional content.
Once the system read tweets for emotions, the researchers taught it to recognise sarcasm, 'MIT Technology Review' reported.
"Because we can't use intonation in our voice or body language to contextualise what we are saying, emoji are the way we do it online," said Iyad Rahwan, associate professor at Massachusetts Institute of Technology (MIT).
"The neural network learned the connection between a certain kind of language and an emoji," said Rahwan. The researchers found that their system performed far better than the best existing algorithms in each case.
They also found that it was better than the humans at spotting sarcasm and other emotions on Twitter.
It was 82 percent accurate at identifying sarcasm correctly, compared with an average score of 76 percent for the human volunteers.