Researchers used 1.2 billion tweets containing at least one of the most popular 64 emojis to develop DeepMoji.
The algorithm learned first to predict which emoji was likely to be used and then to recognise sarcasm, allowing it to spot hate speech faster than humans.
It could also be used to assess how people really feel about different brands or to improve human interaction with smart programs such as chatbots.