A robot that can understand sarcasm in social media posts better than humans could provide a breakthrough in protecting people from abuse online.

Researchers at MIT have created an algorithm that can translate the tone of social media posts and understand if someone is being sarcastic.

The tool interprets emoji used in posts to help it understand emotional subtext and detect if sarcasm is being used.

Called DeepMoji, the AI analysed 1.2 billion tweets to understand how 64 popular emoji were used in them to convey meaning.

"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 the MIT Media lab, according to MIT Technology Review. "The neural network learned the connection between a certain kind of language and an emoji."