Sarcasm might be all over the internet, but it’s still hard to recognize. Researchers want to change that.

A new research paper from two professors—David Bamman from UC Berkeley and Noah A. Smith from the University of Washington—says algorithms can figure out if someone is being sarcastic or not, using social media sites like Twitter.

But what makes this project different than others is its focus on contextual information. When people use sarcasm, there’s quite a bit of background knowledge that’s shared between the two. According to the research paper, which Bamman and Smith worked on during their doctoral studies at Carnegie Mellon University, by understanding contextual information—like who wrote the text and if it’s being shared with friends or the general public—it’ll be easier to recognize sarcasm.

The algorithm trains itself to recognize sarcastic posts by scanning tweets with a “#sarcasm” hashtag. Using machine learning, the algorithm gets better at pointing out sarcasm over time. Then it was put to the test.

The experiment yielded stellar results—the algorithm recognized sarcastic texts 85% percent of the time. Who wrote the tweet was the most important factor—accuracy rose the most when the author’s information was incorporated into the data. But all of the contextual information included in the algorithm—responses, the audience, etc—made the results more accurate than merely analyzing the text on its own.

The data says some people are more likely to use sarcasm than others, like unverified, male, Twitter users from the US (which isn’t shocking, if you’re an avid Twitter user). But the researchers have more commercial and mainstream uses for this technology, which is still a work in progress, including national security and sorting through reviews, says The Horizons Tracker.