Chandler: An Explainable Sarcastic Response Generator (2021)

Abstract: We introduce Chandler, a system that generates sarcastic responses to a given utterance. Previous sarcasm generators assume the intended meaning that sarcasm conceals is the opposite of the literal meaning. We argue that this traditional theory of sarcasm provides a grounding that is neither necessary, nor sufficient, for sarcasm to occur. Instead, we ground our generation process on a formal theory that specifies conditions that unambiguously differentiate sarcasm from non-sarcasm. Furthermore, Chandler not only generates sarcastic responses, but also explanations for why each response is sarcastic. This provides accountability, crucial for avoiding miscommunication between humans and conversational agents, particularly considering that sarcastic communication can be offensive. In human evaluation, Chandler achieves comparable or higher sarcasm scores, compared to state-of-the-art generators, while generating more diverse responses, that are more specific and more coherent to the input.

## introduction the prevalence of sarcasm on the social web @xcite has motivated more and more computational investigations across the research community. most focus on textual sarcasm detection @xcite @xcite @xcite @xcite : the task of classifying whether or not a given text is sarcastic. recently, a new research direction considers sarcasm generation. this is motivated by the potential to create approachable conversational agents. these would be more effective at emulating a human correspondent, considering that sarcasm is a natural part of human discourse @xcite . the limited amount of work on sarcasm generation is spread across two variants of the task: generating a sarcastic response to an input utterance @xcite ; and generating a sarcastic paraphrase of an input utterance @xcite . a major limitation of existing sarcasm generation systems is that they rely on variants of the traditional theory of sarcasm: that the intended meaning concealed by sarcasm is the opposite of the literal meaning. driven by this assumption, their aim is to generate phrases that either express two incongruous propositions @xcite @xcite , or express a proposition that is incongruous to the discourse setting @xcite . however, the traditional theory provides a grounding that is neither necessary, nor sufficient, for sarcasm to occur, as discussed in section 3. furthermore, it is less obvious how previous systems that consider the task of generating sarcastic paraphrases, rather than responses, could be used for enabling conversational agents to generate sarcasm. to overcome these limitations, we first select a formal theory that, from a linguistic-theoretical perspective, specifies devices whose presence is both necessary and sufficient to identify sarcasm, unambiguously differentiating it from non-sarcasm. grounded on this theory, we propose our sarcasm generation system, chandler foot_0 . being grounded in a theory, chandler is also explainable. that is, we are able to generate not only sarcastic responses, but also explanations for why each response is sarcastic. we believe this kind of accountability is crucial for avoiding miscommunication between humans and conversational agents, particularly considering the potentially offensive nature of sarcastic communication @xcite . we employ human annotators on a crowdsourcing platform to evaluate chandler against stateof-the-art generators, across multiple dimensions. chandler achieves comparable or higher sarcasm scores, while generating responses that are more diverse, and are perceived as more specific and coherent than those of previous sarcasm generators. a live demo of the system, allowing users to input an utterance and view sarcastic responses, along with their explanations, is available at https://bit.ly/chandleremnlp . we will also release, along with the camera ready version, all inputs, responses, model checkpoints, and the code that implements chandler, our explainable sarcasm generator, under a creative commons cc by-nc license. ## related work the earliest work on sarcasm generation is that of @xcite , who introduce sarcasmbot, a sarcastic response generation system. sarcasmbot generates a response based on one of eight possible generators, each containing a set of predefined patterns. the generators do not in fact account for the meaning of the input, rather, they only focus on aspects such as the overall sentiment or presence of swear words. @xcite suggest a sarcastic paraphrase generator. they assume that the input is always of negative polarity, and use an unsupervised pipeline of four modules to convert such an input u (-) to a sarcastic version. in the sentiment neutralisation module, they filter out negative sentiment words from u (-) to produce u (0) . in the positive sentiment induction module, they modify u (0) to convey positive sentiment, producing u (+) . next, in the negative situation retrieval module, they mine a phrase v (-) that expresses a negative situation. v (-) is selected from a set of predefined phrases, based on the similarity to the original input. finally, the sarcasm synthesis module constructs the sarcastic paraphrase from u (+) and v (-) . ## methodology the idt directly suggests an algorithm for sarcasm generation that identifies an ironic environment, then creates an utterance that implicitly displays it. we now discuss how we implement each step. ironic environment let u in be an input text to our system. herein, we assume the expectation q that is part of the ironic environment negates what u in proposes. for instance, say u in expresses the event @xmath0. we assume @xmath1. as we shall see, the algorithm we suggest will not, in fact, require us to formulate q, but it relies on the above assumption. allusion to q following @xcite , we define allusion in terms of coherence relations, similar to the relations of rhetorical structure theory (rst) @xcite . that is, if u is an utterance that expresses proposition α, we say u alludes to the expectation q if and only if there is a chain of coherence relations from α to q. so, we need to first select a proposition α to either start or end the coherence chain, then specify the chain between α and q, and formulate u such that it expresses α. we suggest defining such α as objects of if-then relations, where the subject is p , the proposition expressed by input text u in . that is, relations of the form "if p then α" should hold. to infer α given u in , we use comet @xcite , an adaptation framework for constructing commonsense knowledge. specifically, we use the comet variant fine-tuned on atomic @xcite , a dataset of typed if-then relations. 3 . comet inputs the subject of the relation, along with the relation type, and outputs the relation object. in our case, the subject is u in , and we set α to the output. we leverage four relation types. in the examples that follow, assume the input text is u @xmath2: (1) xneed: the object α of a relation of this type specifies an action that the user needed to perform before the event took place, e.g. "if u in then α = [xneed to train hard]"; (2) xattr: the object α specifies how a user that would perform such an action is seen, e.g. "if p then α = [xattr competitive]"; (3) xreact: the object α specifies how the user could feel as a result of 3 we use the comet checkpoint published at http:// bit.ly/comet-checkpoints . algorithm 1: generate sarcastic response input: utterance uin; ironic environment let q := ¬p be the failed expectation; ## conclusion we have presented chandler, a linguistically informed framework for generating sarcastic responses to an input utterance. chandler is the first such system that does not rely exclusively on predefined patterns, and focuses on explainable generation, grounded on a linguistic theory of sarcasm that overcomes the limitations of previous theories assumed by previous sarcasm generators.