Keywords

1 Introduction

Fail again. Fail better. — Samuel Beckett

In this paper, we discuss ideas and propose resources on humor facilitation. We refer to humor facilitators as computer programs capable of detecting potentially humorous events occurring in interactive environments and making them funny through the generation of appropriate comments.

In a previous work on this topic [23], we explored to what extent storytelling could be employed to display a humorous re-interpretation of an unexpected event. The case study showed the effectiveness of an appropriate comic re-interpretation, even though it did not provide a method for performing it from a larger class of interactive situations. One crucial issue is that the humorous re-interpretation of events is a creative process and, as such, knowledge hungry and time-consuming. The required offline process necessary to meet the time constraint would imply a massive effort in knowledge building and indexing. To study a way to overcome these limitations, we focus on user’s mistakes as the preferred unexpected and potentially humorous events.

All complex interactive environments are sources of errors. Some action outcomes are to some degree unpredictable (e.g. if and when a required web page will be loaded). In other cases, the complexity of a technological environment contributes to the unpredictability (e.g. undesired autocompletion while typing a web address or a search query). Mistakes are good events for humor. They are unexpected because unwanted and not meant to occur often. In many types of interactive programs, the possibility that something might go wrong is part of the design as well as the display of error messages. In other words, modeling the knowledge of user’s mistakes is fairly straightforward since part of it is already embedded in the design of the interactive system. In this research, we do not care about mistakes by computer and instead focus on human mistakes as potentially humorous events. The reason is that an artificial agent, to be aware of its errors and to make fun of them, needs to be provided with self-monitoring capabilities not easy to be implemented with state-of-the-art resources. Self-ironic and deceptive agents are beyond the scope of this work.

Another reason for working on human mistakes is that the user can be addressed for being the cause of the undesired event and, thus, be playfully blamed for it. In this way, the humor facilitation can generate comments achieving a form of superiority humor. The user perceives that the computer is making fun of her. However, being mocked by a computer makes the mockery playful.

To have a tool for giving empirical support to the humor facilitation framework, we implemented an online testbed consisting of a humor facilitator and two interactive environments: a text editor and a video game. It is designed to make users perform simple tasks where they are likely to make mistakes. The agent can detect mistakes and, accordingly, gives different types of humorous feedback. The knowledge and linguistic resources underlying event detection and humorous commenting are made available to the research community.

The rest of the paper is organized as follows. In Sect. 2, we give an overview of humorous mistakes, irony, appropriateness, and humor facilitation. Section 3 describes the proposed approach for humor facilitation. We then describe the interactive testbed in Sect. 4. Finally, conclusive remarks and aimed future work are discussed in Sect. 5.

2 Background

2.1 Humorous Mistakes

For years Hofstadter and Moser [9] harvested thousands of examples of linguistic and action mistakes by humans. Started as a hobby, this activity gave them a deeper understanding of the cognitive mechanism underlying the generation of these type of errors. Speech mistakes such as malapropisms or spoonerisms reveal information about personality or cultural background and are often used to intentionally create comical effects [16, 25].

Human mistakes are often hilarious, perhaps because they reveal the vulnerable nature of people and, thus, make observers feel entitled to laugh at them. The assumption of superiority theory is that we laugh about the misfortunes of others; it reflects our superiority. This theory can be found in the work of Plato, Aristotle, and Hobbes. Plato suggests that humor is a kind of malice towards those who are considered relatively powerless. Hobbes further explains that humans are in constant competition with each other, looking for the shortcomings of other persons. He views laughter as an expression of a sudden realization that we are better than others.

Superiority humor reflects on Bergson’s idea of “mechanical inelasticity”. According to it, people making mistakes are comic because their behavior is stereotyped. Their individuality is concealed, and they look mechanical and less human [2]. As rephrased by Nijholt, “like a machine, the body continues with what it is doing, it is unstoppable, until its owner is falling and realizing that rather than gazing at the stars he would have been better off with having noticed the banana peel lying on the street in front of him.” [14].

Mistakes commonly occur in the usage of technological devices and, in particular, computer applications. In some cases, the mistakes are the consequence of an imperfect automatism build to simplify the execution of some task but introducing new sources of flows. A classical example is the autocompletion and autocorrection features for editing text with a smartphone or other computer devicesFootnote 1 [22]. Typing text on a touchscreen smartphone or tablet is time consuming. The users tend to speed-up and without checking possible wrong autocorrection, and discover it only after they have already sent the message.

Newbies are more exposed to error making, but sometimes also experts may make silly mistakes, especially if they are tired or under pressure. Other potentially comic events are the effect of bad planning or partial knowledge of the environment. Cavazza et al. focused on this type of mistakes to formalize the corresponding mechanisms of comedy [5].

2.2 Irony

Irony and sarcasm are effective way to address human mistakes. Verbal irony is a rhetorical device in which the intended meaning of statements is different from (and typically opposite of) the literal meaning. Encyclopaedia Britannica defines verbal ironyFootnote 2 as a “language device [...] in which the real meaning is concealed or contradicted by the literal meanings of the words”. In his account of linguistic theories of irony, Wilson [24] emphasizes three frameworks as key steps. The first theoretical framework, coming from classical rhetoric, describes irony as a form of figurative communication. According to this interpretation, ironic meaning is detected by recipients through a process of inference from the literal meaning and its underlying grammatical structure. A limitation of this approach is that it does not give account of the several cases in which the literal content of the utterance is not sufficient to infer the ironic interpretation. An important theoretical change can be ascribed to Grice [7, 8], which reframed irony as a pragmatic phenomenon and, as such, it should include the communicative intentions of the writer.

A more recent theoretical description was proposed by Sperber and Wilson [17], according to which an ironic utterance is characterized as “echoic”. This term is used to mean that the utterance alludes to some previous remark or a familiar fact, not necessarily expressed by the literal meaning. The intent is to convey a sort of dissociation respect to the fact being echoed. This particular attitude is, thus, the motivation to express a remark in an ironic way.

In the testbed described in Sect. 4, we implemented some of the above concepts for the generation of sarcastic comments as a humorous response to user’s mistakes.

2.3 Appropriateness

According to Nijholt [12], appropriateness is what makes jokes or humorous remarks funny in conversational contexts. Appropriateness “does not only refer to the contents of the remark [...], but in particular on an assessment whether or not to produce the humorous utterance”. Although this statement refers to the particular case of conversational interaction, we believe that it could be applied to a more general class of interactive humor. Moreover, it suggests the conceptual distinction between the generation of humorous text and its selection and communication on the basis of its appropriateness.

To be recognized as appropriate, a humorous message should satisfy a complex set of conditions, such as:

  • Timing. The humorous message generated as a response to some event such as user’s mistake should be communicated early enough to be perceived as causally-related to the event.

  • Semantic relatedness. The humorous message should be semantically related to the target event. It should be about that event. For example, it could be a witty remark addressing the topic of the current conversation or commenting the event just occurred.

  • Humor genre. The style of humor characterizing the message should be the most suitable for the current situation. For example, a sarcastic wit could be used to playfully blame someone for doing something wrong. On the other hand, a silly pun might be more effective in helping someone get distracted by something that worries her.

  • Social acceptance. The message should not be offensive. For instance, it should not contain taboo words [21]. The capability to match this condition is related to the knowledge of the potential recipients.

  • Recipient’s cognitive-affective state. In principle, the message should not distract the recipient if she is performing some task-oriented activity, nor should be delivered if she is in a “negative” mood. In practice, an effective humorous message could be proactively capable of turning a bad mood into a positive one and increase motivation and concentration.

We call temporal appropriateness the first condition and situational appropriateness the remaining ones.

2.4 Humor Facilitation

A humorous system is a computer system capable creating a humorous effect (i.e., inducing laughter or other mirth-related responses). Examples of humorous systems are joke or puns generators [3, 15, 18,19,20,21]. This is, of course, extremely challenging to achieve in an interactive context such as a physical environment, whose dynamic behavior is to many degrees unpredictable and difficult to model and control.

To simplify the problem enough to address it with available technological resources, we focus on a particular type of interactive humorous system called humor facilitator. Figure 1 shows a taxonomy of interactive humorous systems, identified by the following distinctions:

  • Humorous Environments vs. Humorous Agents. While in the former ones the humor effect is achieved through the interaction of humans with the environment, in the latter case the humor is provided by one or more autonomous entities capable of interacting with both the environment and its human inhabitants.

  • Comical Agents vs. Facilitators. We preliminarily introduce the distinction between actually humorous events and potentially humorous events. An event can be considered actually humorous if it typically makes people laugh without any additional intervention. By contrast, an event is potentially humorous if it needs some external condition to become actually humorous. Examples of potentially humorous events are unexpected and surprising events. We call comical agent a humorous agent entirely responsible for the occurrence of a humorous event. Examples of this type are conversational agents producing knock-knock jokes or punning riddles, or pulling practical jokes. Here the interaction is generally planned in advance and based on the induction of stereotyped behaviors in the human participant. Any unexpected event or different behavior might cause the failure of the humorous script. On the other hand, a humor facilitator is defined by the capability to detect a potentially humorous event and make it actually humorous [11, 13, 23]. For example, it might deliver ironic comments about a situation, ridiculing it and, at the same time, creating a playful context.

Fig. 1.
figure 1

Taxonomy of interactive humorous systems.

There is empirical evidence that surprise is a mediator of humor response (i.e. without it there is no laughter) and playfulness is a moderator of humor (i.e. it makes surprise mirthful) [1]. It is widely accepted that humor is a risky process. A joke can be either hilarious or offensive according to the context or the recipient. Accordingly, the main goal of a humor facilitator should be to perform either mediation or moderation of the humor effect, correspondingly increasing both the probability that an event is perceived as humorous and the intensity of the humor appreciation.

The degree of effort required to a humor facilitator depends on the degree of humorousness of a given type of events, that is the probability of inducing the humor response. In other words, the less an event is potentially humorous, the more effort is needed from the humorous agent. On the other hand, highly humorous events are rare and, to make them occur more often, a comical agent should intentionally provoke them.

As shown in Fig. 2, we identify three types of events, each associated to a different degree of potential humorousness. The first type consists of typically funny (as surprising and affectively charged) events (e.g. a baby wearing sunglasses). They make people look funny without the need of additional clues. In this case, the humor facilitation may be limited to just indicating the situation (e.g. through simulated laughter). In some cases, showing a funny event and the context as playful gives people the “permission to laugh”. The second type includes typically surprising but not necessarily funny events (e.g. scary pranks). They can induce either positive or negative emotions, according to the context or the person’s mood. In this case, the facilitation should consist of ways to create a playful context. Finally, the third type includes not typically funny events (e.g. signing a formal document). Here, to be effective, the facilitation should entail a higher creative effort to present the event in a funny perspective, as in the photo at the bottom of Fig. 2.

The best type of candidate events for humor facilitation seems the second type (row 2 in Fig. 2). In fact, they have a good degree of potential humorousness but need some additional help to make the context perceived as playful (i.e., they need to be positively moderated by the facilitator). Moreover, they occur more frequently than events of type 2. Finally, they do not require the creative effort needed to reframe events of type 3 as funny.

Fig. 2.
figure 2

Three types of potentially humorous events.

3 Strategy for Humor Facilitation

Figure 3 illustrates the functional structure of a humor facilitator, which is achieved in two steps: (1) detection of a potentially humorous event (specifically, a human mistake) and (2) generation of an appropriate humor-facilitation comment.

Fig. 3.
figure 3

Main components of the proposed approach to humor facilitation.

Detection of the Potentially Humorous Event. There are several ways to perform this type of event detection. One possibility is to monitor user’s behavior. For example, if the user is using an editing software, she might cancel some wrong edit or press the “Undo” key. If the user is interacting with an online community, the mistake might be detected from the comments by other members. A third source of information about possible mistakes is in the design and code of interactive programs and, specifically, in the instructions for the generation of error messages.

Generation of the Appropriate Humor-Facilitation Comment. Once detected the candidate event, the agent selects and communicates the message aimed to achieve the humorous effect. The event is matched against a repository of one-liners (either collected from textual corpora or computer-generated), in order to select the best one according to the conditions of appropriateness listed in Sect. 2.3.

To achieve situational appropriateness, the system should perform measurements of semantic relatedness between the target event and the set of candidate comments. In particular, it could employ distributional-semantics techniques such as Latent Semantic Analysis (LSA) [6] or Latent Dirichlet Allocation [4]. If available, a module for sentiment analysis or opinion mining [10] could be used not only to check not only if the comment is “about” the target event, but also if it expresses the wanted sentiment about it. Finally, if the message satisfies the conditions for appropriateness, it is identified as humorously appropriate and, thus, delivered to the human recipient. If not, the system will continue listening for a new potentially-humorous event. The information about the events is also useful to select the type of comment and the corresponding type of humor (e.g. to decide to what extent aggressive humor should be acceptable). To this aim, the capability to modeling the cognitive and affective state of the human recipient and its social background would be a considerable help.

To satisfy the temporal appropriateness condition, the comment should be delivered within a specific time interval after the event occurrence. The temporal threshold should be fixed in advance and related to the particular type of humorous effect to achieve. In most cases, it should be communicated as soon as possible. Sometimes, by contrast, a delayed remark could be more effective. For example, comments like “Did you see what just happened?” or “Did you really do that?” (or their equivalent one-liners) might play with the possibility that the human recipient is not aware to have made a mistake or is trying to hide it. However, the best way to achieve an effective timing is to perform, whenever possible, an “offline” check of the appropriateness conditions for a class of potentially occurring events, and a corresponding indexing of the database of humorous comments.

4 Testbed

We implemented the humor-facilitation strategy, described in the previous section, as an interactive web serviceFootnote 3. This system is made available to researchers that intend to perform empirical studies of the connection between humor facilitation and human response. It is meant to be a modular system to be enriched over time with additional functionalities. The current version consists of two environments and a humor facilitator. In each environment, the user can perform simple tasks and read instruction and comments sent by the agent.

The first environment is an editable text field, where the user can write or modify a document in English. Possible tasks are free writing or answering questions. A second text field is used to show the messages from the agent. Possible user’s mistakes are typing wrong English words (in the free-writing task) or wrong answers (in the question-answering task).

The second environment is a simple video game called Basketball Shot. It consists of a ballistic launcher, shown in the left-bottom corner of a canvas. Clicking on it, a ball is launched toward the basket on the opposite side. With the help of a slider, the player can modify the orientation of the launch. The possible user’s mistake is, of course, missing the basket. Since the system can calculate the trajectory of the ball while it is on the way, the agent can make comments even before the mistake has occurred.

To increase the probability of mistakes, we use a simple, non-deceptive trick: the task is temporally constrained, and a countdown timer is shown in the corner of both environments. The tasks are constrained in such a way they can hardly be achieved before it is game over. In a first version of the system, we introduced subtle forms of deception. Later on, however, we decided to remove this feature, to maintain the focus on humor facilitation. In fact, the deceptive behavior makes the system more recognizable as a comical agent than as a humor facilitator (according to the distinction discussed in Sect. 3).

The generation of humor-facilitation comments is designed according to available resources and two central research questions. The first research question is to what extent the combination of state-of-the-art verbal-humor generation and semantic relatedness are sufficient to increase the humorousness of the event significantly. To achieve situational appropriateness, we require that the outputs of the generator contain at least one word semantically related to the words describing the event. In the specific case of mistakes, their nature suggests generating “valenced comments” expressing an evaluative content. Accordingly, we provided the system with the capability to produce different types of valenced comments: (1) plain comments represented by error messages or performance scores, (2) affectively charged comments expressing either disdain or solidarity, and (3) sarcastic comments, apparently praising the user but actually blaming her (e.g. “Well done!”, “I am glad you can accomplish such a difficult task so easily...”, or “You’re as capable as a horse to create French cuisine.”).

5 Conclusions

In this paper, we propose two changes of perspective on interactive humor and, correspondingly, the way to design it. First, we shift the focus from humorous texts to humorous events. Second, we do not consider humorousness as an intrinsic property of events. Rather, we view it as the degree to which an event can be made funny through humor facilitation. In other words, what is meant to be funny is not the event alone, or the agent’s comment alone, but the event-comment pair. For this reason, a central role is played by the categorization of events according to a prefixed number of event types (e.g. surprising events, mistakes, emotional events, etc.). Each category should be associated to a corresponding level of potential humorousness and a corresponding type of humor facilitation. We specifically focus on human mistakes as potentially humorous events because they are often sources of hilarity and tend to induce funny comments. Therefore, the most natural corresponding types of humor-facilitation comments employ irony and sarcasm.

As a future work, we aim to extend the knowledge base underlying the generation of humor-facilitation comments to represent not only potentially-humorous events but also potentially funny personality types. They would enable the system to produce sarcastic comments evoking ridiculous traits of people. The distinction between humor facilitator and comical agent is another key aspect of this work. Humor facilitators are intended to react to unpredictable events, while comical agents are supposed to plan and provoke them purposefully. If employed in complex environments, the achievement of humor facilitation seems to be more feasible. Above all, the view behind humor facilitation helps us to believe that funny things are already there. We only need to see them with different eyes.