A guest takes a selfie with her smartphone during the Mercedes Benz Fashion Week in Madrid on April 8, 2021

A guest takes a selfie with her smartphone during the Mercedes Benz Fashion Week in Madrid on April 8, 2021 Photo by GABRIEL BOUYS/AFP via Getty Images

How to Detect Sarcasm with Artificial Intelligence

Humans make inferences about tone and meaning, but algorithms can find hidden relationships between words to detect irony and intentional falsehood.

A new AI tool funded in part by the U.S. military has proven adept at a task that has traditionally been very difficult for computer programs: detecting the human art of sarcasm. It could help intelligence officers or agencies better apply artificial intelligence to trend analysis by avoiding social media posts that aren’t serious. 

Certain words in specific combinations can be a predictable indicator of sarcasm in a social media post, even if there isn’t much other context, two researchers from the University of Central Florida noted in a March paper in the journal Entropy

Using a variety of datasets of posts from Twitter, Reddit, various dialogues and even headlines from The Onion, Garibay and his colleague Ramya Akula mapped out how some key words relate to other words. “For instance, words such as ‘just’, ‘again’, ‘totally’, ‘!’, have darker edges connecting them with every other word in a sentence. These are the words in the sentence that hint at sarcasm and, as expected, these receive higher attention than others,” they write. 

The method relies on what the researchers refer to as a self-attention architecture, a method for training complex artificial intelligence programs called neural networks to give more weight to some words than to others, depending what other words appear nearby and what the program is tasked to do. 

“Attention is a mechanism to discover patterns in the input that are crucial for solving the given task. In deep learning, self-attention is an attention mechanism for sequences, which helps learn the task-specific relationship between different elements of a given sequence to produce a better sequence representation” Ivan Garibay, one of the researchers, told Defense One. (The concept originally goes back to a paper by a German and Canadian researcher from 2016.) 

Detecting sarcasm with algorithms may not seem to have much military relevance but consider how much more time people spend online than just a few years ago. Also consider the growing role of open-source intelligence, like social media posts, in helping the military to understand what’s happening in key areas where they might be operating. The work was supported by the Defense Advanced Research Projects Agency, or DARPA, through a program called Computational Simulation of Online Social Behavior. The program seeks a “deeper and more quantitative understanding of adversaries’ use of the global information environment than is currently possible using existing approaches.”

It’s not the first time researchers have tried to use machine learning or artificial intelligence to detect sarcasm in short pieces of text, like social media posts. But the method improves on previous efforts, many of which were based on training algorithms to search for too many very specific cues handpicked by the researchers, like words suggesting specific emotions or even emojis. That resulted in the algorithm missing many instances of sarcasm that didn’t have those features. 

Other methods used neural networks to find hidden relationships. These tend to perform better, Garibay said. But it’s impossible to tell how the neural network reached the conclusion that it reached. Garibay says  the key advantage of the new technique is that performs as well as other neural networks in detecting sarcasm but allows the user to go back and see how the model achieved the results that it did, which is something intelligence officials have said is essential for the use of artificial intelligence in the context of national security. 

The next big challenge is handling ambiguities, colloquialisms, slang, “and coping with language evolution,” Garibay said.

X
This website uses cookies to enhance user experience and to analyze performance and traffic on our website. We also share information about your use of our site with our social media, advertising and analytics partners. Learn More / Do Not Sell My Personal Information
Accept Cookies
X
Cookie Preferences Cookie List

Do Not Sell My Personal Information

When you visit our website, we store cookies on your browser to collect information. The information collected might relate to you, your preferences or your device, and is mostly used to make the site work as you expect it to and to provide a more personalized web experience. However, you can choose not to allow certain types of cookies, which may impact your experience of the site and the services we are able to offer. Click on the different category headings to find out more and change our default settings according to your preference. You cannot opt-out of our First Party Strictly Necessary Cookies as they are deployed in order to ensure the proper functioning of our website (such as prompting the cookie banner and remembering your settings, to log into your account, to redirect you when you log out, etc.). For more information about the First and Third Party Cookies used please follow this link.

Allow All Cookies

Manage Consent Preferences

Strictly Necessary Cookies - Always Active

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Sale of Personal Data, Targeting & Social Media Cookies

Under the California Consumer Privacy Act, you have the right to opt-out of the sale of your personal information to third parties. These cookies collect information for analytics and to personalize your experience with targeted ads. You may exercise your right to opt out of the sale of personal information by using this toggle switch. If you opt out we will not be able to offer you personalised ads and will not hand over your personal information to any third parties. Additionally, you may contact our legal department for further clarification about your rights as a California consumer by using this Exercise My Rights link

If you have enabled privacy controls on your browser (such as a plugin), we have to take that as a valid request to opt-out. Therefore we would not be able to track your activity through the web. This may affect our ability to personalize ads according to your preferences.

Targeting cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising.

Social media cookies are set by a range of social media services that we have added to the site to enable you to share our content with your friends and networks. They are capable of tracking your browser across other sites and building up a profile of your interests. This may impact the content and messages you see on other websites you visit. If you do not allow these cookies you may not be able to use or see these sharing tools.

If you want to opt out of all of our lead reports and lists, please submit a privacy request at our Do Not Sell page.

Save Settings
Cookie Preferences Cookie List

Cookie List

A cookie is a small piece of data (text file) that a website – when visited by a user – asks your browser to store on your device in order to remember information about you, such as your language preference or login information. Those cookies are set by us and called first-party cookies. We also use third-party cookies – which are cookies from a domain different than the domain of the website you are visiting – for our advertising and marketing efforts. More specifically, we use cookies and other tracking technologies for the following purposes:

Strictly Necessary Cookies

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Functional Cookies

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Performance Cookies

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Sale of Personal Data

We also use cookies to personalize your experience on our websites, including by determining the most relevant content and advertisements to show you, and to monitor site traffic and performance, so that we may improve our websites and your experience. You may opt out of our use of such cookies (and the associated “sale” of your Personal Information) by using this toggle switch. You will still see some advertising, regardless of your selection. Because we do not track you across different devices, browsers and GEMG properties, your selection will take effect only on this browser, this device and this website.

Social Media Cookies

We also use cookies to personalize your experience on our websites, including by determining the most relevant content and advertisements to show you, and to monitor site traffic and performance, so that we may improve our websites and your experience. You may opt out of our use of such cookies (and the associated “sale” of your Personal Information) by using this toggle switch. You will still see some advertising, regardless of your selection. Because we do not track you across different devices, browsers and GEMG properties, your selection will take effect only on this browser, this device and this website.

Targeting Cookies

We also use cookies to personalize your experience on our websites, including by determining the most relevant content and advertisements to show you, and to monitor site traffic and performance, so that we may improve our websites and your experience. You may opt out of our use of such cookies (and the associated “sale” of your Personal Information) by using this toggle switch. You will still see some advertising, regardless of your selection. Because we do not track you across different devices, browsers and GEMG properties, your selection will take effect only on this browser, this device and this website.