A Massive Sarcastic Robot: What a Great Idea! Two Approaches to the Computational Generation of Irony

Irony is a versatile seasoning for language that is just as useful for sugaring insults as for salting compliments. It is a flavoring that adds bite to much of our online interaction, making its computational analysis – recognition and understanding – a necessity for affective language processing. If the computational generation of irony is a harder sell, it is perhaps because this mode of communication is so often vexing for humans too. However, an artificial fluency with irony is as desirable as fluency in any form of creative language, from metaphor and analogy to humour and persuasive argumentation. We explore two distinct approaches to irony generation in this paper: knowledge-based generation ab initio, and a more shallow approach we name ‘mere re-generation.’ We consider the relative merits of each, conduct a user evaluation, and demonstrate some practical uses. The Devil’s Seasoning To communicate with irony is to talk with a forked tongue. Yet while the need for the computational analysis of irony is strong, since so much of our online language is playfully or scornfully sardonic (Hao & Veale, 2010; Reyes et al., 2013; Ghosh & Veale, 2017), the case for computationally generating irony is much less compelling. However, there are practical reasons for granting our machines a fluency in this challenging mode of communication. Irony requires a delicate blending of mental spaces to concisely express a double-edged attitude to a failed expectation: we highlight an expectation, act as though it were fulfilled, and criticize its lack of fulfilment, all in a single breath. So a generative model of irony is also, by necessity, a model of conceptual blending (Fauconnier & Turner, 2002), one that lends not just concision, but creativity too, to a machine’s outputs. An ironic statement can be a most charming disguise for a conceptual conflict, though the charm of the disguise and the profundity of the conflict will vary from one speaker to another – skill is a factor, after all – and with the obviousness of the context. Irony is a subtle form of sarcasm (conversely, sarcasm is a vulgarized form of irony) in which we believe in what we say but not how we say it. So when we use the norms of flattery to sweeten an insult, or the norms of criticism to sour a compliment, we intend an audience to appreciate the seasoning but to look beyond it too, to grasp our deeper meaning and our ambivalent attitude towards it. Ironies, like metaphors, are allusive (if sometimes elusive) products of the imagination that appeal to the imaginations of others. But these products are not built in a vacuum; an ironic worldview makes a critical claim about something in the world that others can see and evaluate for themselves. For a machine to generate an ironic observation, it needs knowledge of how things are and how they should be, and it needs the ability to frame the gap between the two in a pithily suggestive fashion. So, as befits the duality of irony, we explore two approaches to its generation in this paper. The first is a knowledge-based approach that explicitly models that which is expected and that which is observed, so as to juxtapose them both in the same tweet-sized text. We use disanalogy as the unifying conceit to maximize the dissonance between the two perspectives, but the resulting text also supports other markup strategies to signal ironic intent to an audience. While the most obvious applications of machine-generated irony may well be human-computer interfaces, a less obvious, but no less useful, application is the generation of well-controlled test-data for experiments into the human appreciation of irony. Our evaluation of this parameterized approach shows how linguists can better understand how we as humans process irony, by presenting human subjects with the products of machine creativity. How do we humans acquire our sense of the ironic? This sense is not something we are born with, but something we cultivate over time, such as via continuous exposure to the ironic stylings of others. A machine can also be exposed to ironic language to learn its signature qualities, with social media platforms such as Twitter making it easy to retrieve large amounts of texts that are self-annotated with the hash tags #irony, #sarcasm and #yeahright. The overt tagging of verbal pretence is not a new phenomenon, even if Twitter elevates the practice to new levels of explicitness. Speakers have always used subtle cues to signal their ironic intent. By harvesting a broad spectrum of cued ironic texts from the web, a machine can build a large case-base of attested examples to be reused wholesale, or recycled with novel variations, as parts of its own future utterances. Our second approach does not analyse these web examples in any great depth, but pursues a philosophy we dub mere regeneration to find new uses and framings for old word combinations. The qualities that make one juxtaposition of words or ideas seem more poetic, more beautiful, more ridiculous or more hilarious than others may not always defy logical scrutiny, but for all practical intents they remain ineffable for now. Our machines should thus do what most humans do at one time or another: reuse the resonant combinations of words that have worked for others and claim them for themselves. We present each of these approaches in the sections to follow, beginning with a review of related work and ideas in the next. After an empirical evaluation of the first, and a discussion on how the second supports the rapid development of humorous CC systems, the paper concludes with a discussion of the relative merits of each approach to irony. Related Work and Ideas To judge by the diversity of tweets that Twitter users tag with #irony, the general public operates with a somewhat diffuse understanding of what irony is. The popular view, and the most oversimplified, is that to speak ironically is to say one thing but to mean its opposite (Kierkegaard, 1841; Grice, 1978). But irony is a nuanced idea that demands just as nuanced a definition, and irony-as-opposite disappoints on several fronts: it is meaningful for just a subset of the utterances that speakers intuitively grasp as ironic; even in such cases, opposition accounts for just one aspect of the intended meaning; and even then, it is not always obvious how one can arrive at the opposite of an ironic statement. Recall a scene in the film Amadeus in which the composer Salieri has just premiered his new opera. When put on the spot for a positive response, Mozart shrewdly replies that “When one hears such music, one can only think ‘Salieri’!” Mozart’s words are criticism masked as flattery and Salieri suspects as much, though he cannot know for sure. But what is the opposite of Mozart’s reply here – that one does not think of Salieri when hearing such music? No, what is inverted here is not what Mozart says but what he implies, “When one hears such [lovely] music, one can only think ‘Salieri’!” His ironic meaning thus becomes “When one hears such [unlovely] music, one can only think ‘Salieri’!” To speak ironically then is to say one thing, insincerely imply the obvious, and intend something so different that it often amounts to the opposite of what is implied. This constitutes an act of verbal pretence (Clark & Gerrig, 1984) and pragmatic insincerity (Kumon-Nakamura et al., 1995) that is designed to be penetrated by audiences. But if ironic statements are meant to be understood as such, they spark a conflict of implications between the default and the nondefault (Giora et al., 2015), or the obvious and the creative, that audiences must somehow resolve for themselves. The context often determines how fraught this conflict will be, with contexts that are strongly supportive of an ironic interpretation nudging audiences to look past the obvious. In contexts that are equally supportive of the default and nondefault interpretations, the audience is left – like Salieri – in a rather uncomfortable superposition of affective states. In such cases, authors have a number of ways to nudge an audience toward the creative. Many ironic utterances are context-external, which is to say that the information one needs to discern ironic from non-ironic is found outside the utterance itself. Mozart’s reply is a context-external irony. Many more are context-internal, insofar as an author bakes the necessary context into the utterance itself. For example, consider this classic image from Farewell My Lovely by Raymond Chandler: “He looked about as inconspicuous as a tarantula on a slice of angel food cake.” The He is Moose Malloy, a hulking white brute who is newly-released from prison and in search of his faithless wife Velma in a black neighborhood of the city. Throwing discretion to the wind, the white Malloy stomps about town, terrifying the locals while sticking out like a large black spider on a white cake. The comparison is enough to alert readers that Malloy is the very opposite of inconspicuous. Yet note that the simile means more than “Malloy was very conspicuous indeed.” It means “Malloy should have tried to be inconspicuous, but the dumb brute could not be subtle if he tried.” We use irony to conflate perspectives and to criticize, all at once. Besides building useful context into his simile, Chandler also prefaces the comparison with “about”, a marker of imprecision that alerts readers to his insincere use of words. Hao & Veale (2010) use these markers of imprecision to harvest creative similes in bulk from the web. While the marker “about” is not reserved for ironic comparisons – that depends on whether the simile is intended as flattery or criticism – it is a reliable marker of linguistic creativity. As analyzed in Veale (2013), about-similes tend to use longer descriptions (or “vehicles”) that constitute what Fishelov (1992) deems PS (poetic similes). He contrasts these with the NS (non-poetic) similes that pervade language, such as “clea