Elamur Research

A Long Short-Term Memory Framework for Predicting Humor in Dialogues

Paper · 2016 · Dario Bertero and Pascale Fung

Summary

A line in a conversation can be funny because of what someone said just before it. In an exchange from The Big Bang Theory, a bartender asks a customer to clarify his order. His answer specifies the chemical name for the kind of alcohol he wants. The wording is precise, but the precision is out of place at a bar. Dario Bertero and Pascale Fung ask whether a system can use that sort of conversational buildup to predict where an audience is expected to laugh. They use sitcom transcripts for the dialogue and the timing of the show’s recorded laughter to identify the lines the system is supposed to find.

The system reads a scene at two levels. A convolutional neural network assembles a representation of each line from short stretches of text. It takes account of exact words, fragments of their spelling, and associations captured by word embeddings. A long short-term memory network, or LSTM, then reads those line representations in order. It updates a running state as the conversation develops, so the classification of a line can depend on earlier turns. Before making the final prediction, the system also receives explicit information such as who is speaking, where the line falls within the speaker’s turn, and how its length compares with recent lines.

On the held-out sitcom episodes, the complete system reached 70.0% accuracy and a 62.9% F-score, which combines how many labeled punchlines the system finds with how often its punchline predictions are correct. The strongest conditional random field baseline by F-score reached 58.1% on that metric. The complete system found more of the labeled punchlines than any of the baselines, although the baseline that used only the explicit language and dialogue features had slightly higher precision. When the authors kept the scene-level LSTM and changed the line encoder from a convolutional network to another LSTM, the F-score fell to 59.1%.

The result concerns a particular kind of audience cue. A line counted as a punchline if recorded laughter followed it within 1s. That rule supplies labels at the scale of a television corpus, but laughter inserted during production can accompany a weak joke or help keep a scene lively. The experiment shows how much the architecture helps predict those cues in held-out episodes of the same show. The authors propose collecting humorous interactions with a virtual agent to investigate whether the approach can carry over to human–robot conversation.

Deep dive: A Long Short-Term Memory Framework for Predicting Humor in Dialogues

This paper tests whether long short-term memory can use earlier sitcom dialogue to predict which lines will be followed by laughter. · about 33 minutes to read

The problem and its context

What makes a line funny in a scene

The paper starts from a difference between collecting jokes and finding moments of humor in a conversation. A collected joke arrives as a unit. An utterance in a sitcom can be a short answer, the continuation of another character’s thought, or another step in a series of increasingly peculiar remarks. Finding the funny moment therefore involves deciding which line brings the exchange to a point where laughter is expected. The phrase setup–punchline relation describes that dependence. Earlier remarks prepare the audience to interpret what follows, and a later line gives them a reason to laugh.

The authors illustrate this with a bar scene. Penny asks Sheldon what he wants to drink. He requests alcohol in general terms, so she asks him to be more specific. He supplies a chemical description and then gives a quantity in milliliters. Penny’s difficulty with the unit sends the exchange into a discussion of a former president and the adoption of the metric system. The paper marks laughter at several points along that progression. The sequence lets the reader see how the subject of the exchange changes while each remark still depends on what came before.

The chemical description has an ordinary interpretation in some settings. It becomes an odd answer to a bartender because the practical question is which drink to serve. The remarks about metrication also have an ordinary interpretation in isolation. In the scene, their connection to the order gives them a different role. A search for individually comic words would have to learn a fairly arbitrary association between those words and laughter. A system that has access to the exchange can at least use evidence about what the characters are trying to do and how the current reply fits.

The example also shows why the authors frame the problem as labeling utterances instead of dividing a scene into entire jokes. A scene can contain several audience reactions. Some material that helps prepare a later reaction can already have prompted an earlier one. A line may answer the preceding speaker and supply material for the next exchange at the same time. The study’s labels indicate which utterances were followed by laughter. They leave the extent of each setup implicit.

How earlier work framed humor and context

The introduction places the study alongside work on humor, irony, and sarcasm. Much of the research the authors discuss drew its examples from tweets, reviews, or collections of standalone jokes. Those studies established ways to treat figurative or humorous writing as a recognition problem. The objects of classification were frequently complete written items. A tweet or review can of course refer to a wider situation, and the paper also names work that incorporated surrounding context into the analysis of online language.

Some of the cited work treated a mismatch as evidence. One example examines how a positive expression can take on a sarcastic reading when it describes an unfavorable situation. The pertinent feature is the relationship between the expression and what it is about. In the sitcom study, the contrast of interest can arise across turns, as when a sensible request for clarification receives an answer that is precise in an unexpected way. Both cases illustrate how the meaning or effect of a phrase can depend on a larger unit than the phrase itself. Sarcasm as Contrast between a Positive Sentiment and Negative Situation

The paper also cites research on irony in tweets and on contextual incongruity in sarcasm detection. Other cited studies explicitly included contextual information, so the historical claim is narrower than saying that earlier humor research ignored context. The distinctive question here is how to represent a sequence of spoken lines with changing speakers and several potential audience reactions. The prediction is made for each utterance along that sequence. Modelling Irony in Twitter · Harnessing Context Incongruity for Sarcasm Detection

Work on standalone jokes supplied a related precedent. The paper cites research on recognizing humor and locating humor anchors, the parts of an item associated with its humorous effect. The sitcom task asks for a location at a different scale. Its output identifies a line in a scene where a reaction is expected. It does not assign a role to a particular word or trace which part of an earlier turn helped set it up. Humor Recognition and Humor Anchor Extraction

Bertero and Fung had already worked with the same sitcom corpus. They describe trying a sliding window represented by a bag of n-grams, sequences of adjacent tokens treated as features, and a simple recurrent neural network. A sliding window gives a classifier direct access to recent wording, but the inventory of phrases provides a limited account of how an exchange develops. A simple recurrent network passes information forward, but the authors were concerned about how well it could preserve relevant details across successive updates. The new architecture grew out of those two considerations.

Long short-term memory offered a way to make retention part of the learned computation. The authors point to earlier uses in speech recognition, syntactic analysis, and conversation. These tasks differ in their outputs, but they give the paper a rationale for choosing an architecture that can use preceding inputs when interpreting a current one. The authors present its application to humor response prediction and humor detection as new to their knowledge. Speech Recognition with Deep Recurrent Neural Networks · Transition-Based Dependency Parsing with Stack Long Short-Term Memory · Neural Responding Machine for Short-Text Conversation

Why predict a reaction?

The application the authors have in mind is a conversational machine that can respond to a user’s humor. Identifying an appropriate moment to react is one part of that problem. The intended reaction gives the authors a concrete prediction target, whereas explaining the entire joke or generating an entertaining reply would require different outputs. The paper treats this prediction problem as a step towards more responsive dialogue systems.

A sitcom provides an unusually convenient combination of material for the question. It offers connected exchanges with speakers and scene boundaries, and its soundtrack indicates moments at which a response is expected. That lets the researchers formulate an utterance-level text classification task. For each line, the system must choose between a punchline label and the alternative. It learns from a set of scenes in which the labels have already been assigned using the soundtrack.

That operational meaning of punchline is central. The label refers to a timing relationship between a line and laughter in a specific production. The setup, by contrast, is something the authors expect the sequence of earlier turns to convey. The procedure supplies a target for learning when a reaction occurs without requiring someone to mark which prior words supplied the expectation that the punchline plays on. The architecture and the experiment are both organized around that distinction.

The method, step by step

From an episode to labeled lines

The authors combine subtitles, scripts, and episode audio. The subtitles supply the timing of utterances. The scripts supply scene divisions and speaker identities. The audio supplies the laughter cues used to determine the target. These sources play different roles. Scene divisions establish the scope of the conversation given to the recurrent stage, speaker identity can help with the final prediction, and detected laughter tells the training procedure which output the system should produce.

To locate laughter, the authors process the audio with a vocal removal tool and then use a detector that distinguishes sound from silence. They identify the timestamps of canned laughter and compare them with the utterance timing. An utterance receives the punchline label when laughter follows it within 1s. The other utterances receive the alternative label and are treated as potential setup material. The authors thus obtain a sequence with a label at each position, even though the timing rule assigns no explicit links between a particular punchline and its setup.

The distinction carries over to what the system sees. The detected laugh is used to construct the answer against which a prediction is evaluated. In the architecture, the inputs for classifying a line come from the wording and the high-level features, including timing information from subtitles. The classifier is learning to anticipate the laughter cue associated with the line. Its job is different from the audio preprocessing task of finding a sound that has already occurred.

The scene supplies the outer unit of the method. Within it, each utterance first goes through a word-level computation that produces a single vector, an ordered collection of learned numerical features. The scene-level stage reads those vectors in their spoken order. At each position it supplies a representation of the current point in the dialogue, which is joined to explicitly defined features before the final prediction.

From sitcom recordings to punchline predictions

The steps in order.

From sitcom recordings to punchline predictionsStep 1: Align utterances, scene boundaries, and speaker identities1. Align utterances, scene boundaries, and speaker identitiesStep 2: Label utterances from laughter timestamps2. Label utterances from laughter timestampsStep 3: Represent each token through parallel input features3. Represent each token through parallel input featuresStep 4: Convolve and pool within each utterance4. Convolve and pool within each utteranceStep 5: Read utterance vectors in scene order5. Read utterance vectors in scene orderStep 6: Add explicit language and dialogue features6. Add explicit language and dialogue featuresStep 7: Predict the label for each utterance7. Predict the label for each utterance

Three views of a word

The line encoder starts from tokens, the word-level items in an utterance. Each token is represented in three ways. The resulting views let the system learn from the identity of a word, its spelling, and its general distributional meaning. The paper applies the same broad encoding procedure to each view separately before combining their contributions at the line level.

The word-token input is a one-hot vector. A position in the vector corresponds to a vocabulary item, and the active position identifies the current token. This gives the encoder a direct way to distinguish particular words and learn how their occurrence relates to the labels in the sitcom corpus. Two different words occupy distinct positions even when their meanings are close. The dense representation learned from this input can then express associations useful for the task.

The character input represents each word as a bag of character trigrams. A trigram is a sequence of adjacent characters. A bag records which pieces of spelling occur within a token without presenting the complete word as an inseparable identity. This view can express a resemblance between tokens that share letter sequences. The authors use it to capture cues in a word’s form with less dependence on the stem as the basic unit. The trigrams belong to the input for an individual token, while the line encoder still processes the resulting token representations in their utterance order.

The third input uses word2vec vectors trained on the text9 Wikipedia corpus. These vectors bring information derived from word usage in a collection outside the sitcom. Their purpose is to let words with related meanings contribute in similar ways, including words for which the training scenes provide little direct evidence. The one-hot input consequently gives the network a route to associations tied to a particular vocabulary item, while word2vec supplies broader associations. Efficient Estimation of Word Representations in Vector Space

The division between the three views matters for understanding the system’s treatment of lexical evidence. If the same word appears in a punchline and an ordinary reply, its presence is only part of the input. Its neighboring tokens can change the expression in which it occurs, and the history of the scene can change the role of that expression. The representation of the word supplies material for both computations. The paper does not give any one of the word inputs responsibility for deciding that a line is funny.

How convolution turns words into a line representation

A convolution examines a moving window of token representations. In this study the convolutional window has width 5. The transformation applied to a window is shared across positions, so a learned local pattern can contribute wherever it appears within the utterance. The operation produces features of small groups of tokens. It can therefore use the company a word keeps within the line, while the next stage handles the company that line keeps within the scene.

The procedure starts by mapping input features into compact, dense representations. The local transformation then produces a set of responses across the utterance. A response can be thought of as the value of a learned feature at a particular position. The computation still distinguishes positions at this stage, since adjacent tokens enter the window together and their arrangement affects the features it produces.

Max pooling then keeps the largest response for each feature across the line. This is how the encoder reduces a variable number of token positions to a fixed-size representation. An especially strong response in one part of a line can survive even when the rest of the line is less distinctive. The pooling operation keeps the strength of that response and drops its location from the pooled value. It consequently favors an account of which local patterns are present over an account of exactly where each one appeared.

Convolution and pooling are done independently for word tokens, character trigrams, and word2vec. The pooled vectors are placed end to end, a procedure called concatenation. A final encoding layer combines them into the utterance vector. This learned combination gives the next stage a common input format for lines of different lengths and lets the earlier layers extract different evidence from the three views.

In the bar example, the phrase in which Sheldon specifies a kind of alcohol belongs to this first level. The encoder can represent wording that evokes a technical register. The earlier request for a drink and Penny’s question about what he wants belong to other utterances. Their relation to the current reply enters at the second level. Keeping those computations distinct is the central architectural choice. It gives the system one way to recognize wording within a line and another way to track a developing exchange.

What the scene-level recurrence adds

A recurrent network reads a sequence by repeatedly updating an internal state. At any utterance, the current input is the line vector and the preceding state carries information from the earlier dialogue. The paper first describes the update for a simple recurrent network, then introduces the gated update used in the study. Its simple recurrent update is:

hₜ = tanh(Wₓ xₜ + Wₕ hₜ₋₁ + b)

Here t is the current position in the utterance sequence, and t−1 denotes the preceding position. xₜ is the current input vector. hₜ is the updated hidden state and hₜ₋₁ is the previous hidden state. The learned matrices Wₓ and Wₕ act on the input and the previous state, respectively. b is a learned bias vector. The products with the matrices transform their respective vectors, + adds the resulting contributions, and tanh applies the hyperbolic tangent to each component.

The simple update mixes the current input and the previous state, then sends that mixture through a nonlinear function. Each incoming line transforms what has been carried forward. The paper argues that this makes information difficult to preserve across many updates. It also gives the architecture no separate gate whose specific job is to turn off an outdated contribution. An LSTM introduces an internal cell state and learned gates that regulate what enters it, what stays in it, and what becomes visible in the hidden state.

The first gate controls the contribution from new material:

iₜ = σ(Wᶦₓ xₜ + Wᶦₕ hₜ₋₁ + bᶦ)

iₜ is the input gate at utterance position t. xₜ is the current line vector and hₜ₋₁ is the preceding hidden state. Wᶦₓ and Wᶦₕ are the learned input-gate matrices for those two vectors, and bᶦ is the bias for this gate. σ is the sigmoid function, applied component by component to the sum indicated by +. It yields gate values that can suppress or pass the corresponding components of the proposed new material. The superscript i identifies the input-gate parameters.

The next gate controls the contribution carried forward from the earlier cell state:

fₜ = σ(Wᶠₓ xₜ + Wᶠₕ hₜ₋₁ + bᶠ)

fₜ is the forget gate at position t. Wᶠₓ transforms the current input xₜ, and Wᶠₕ transforms hₜ₋₁, the hidden state at the previous position. bᶠ is the learned forget-gate bias. The superscript f identifies the parameters for this gate. The transformed vectors and the bias are added, and σ applies the sigmoid to each component. A small value in a component of fₜ suppresses the corresponding component of the earlier cell state during the update.

A separate gate controls which components of the updated cell state appear in the hidden output:

oₜ = σ(Wᵒₓ xₜ + Wᵒₕ hₜ₋₁ + bᵒ)

oₜ is the output gate at the current position t. Its learned matrices are Wᵒₓ for the current input xₜ and Wᵒₕ for the previous hidden state hₜ₋₁. bᵒ is the learned bias for the output gate. The superscript o identifies those parameters. The + signs indicate addition of the two transformed vectors and the bias. σ again applies the sigmoid to each component. The gate allows information to remain in the cell even when the hidden state does not expose it at the current utterance.

The network also computes the new content that could be written into the cell:

sₜ = tanh(Wˢₓ xₜ + Wˢₕ hₜ₋₁ + bʰ)

sₜ is the proposed cell input at position t. Wˢₓ transforms the current utterance vector xₜ, and Wˢₕ transforms the previous hidden state hₜ₋₁. The superscript s identifies the matrices used to propose new content. bʰ is the bias term written for this update in the paper. The matrix products and bias are added with +. tanh applies the hyperbolic tangent to the sum, component by component. This vector supplies candidate content, whose effect on the cell is determined by the input gate.

The cell update combines retained information with gated new information:

cₜ = fₜ ⊙ cₜ₋₁ + iₜ ⊙ sₜ

cₜ is the cell state at utterance position t, and cₜ₋₁ is the cell state at the previous utterance. fₜ is the forget gate, iₜ is the input gate, and sₜ is the proposed cell input. ⊙ is element-wise multiplication, so each gate value scales the component in the same position of the vector it acts on. + adds the retained and new contributions. A component of iₜ equal to 0 blocks the proposed write at that position. A corresponding forget gate that passes the earlier cell value allows that value to persist. A component of fₜ equal to 0 removes the earlier value from the update even when new content is written there.

Finally, the hidden state reveals the gated output of the cell:

hₜ = tanh(cₜ) ⊙ oₜ

hₜ is the hidden state at position t, cₜ is the updated cell state, and oₜ is the output gate for that position. tanh applies the hyperbolic tangent to each component of the cell state. ⊙ then multiplies the transformed cell state by the output gate component by component. An output gate value of 0 suppresses a component here while leaving its contribution to the cell state untouched by this last operation.

Together, the updates give the sequence a route by which earlier information can survive several intervening lines. The candidate update can respond to the current utterance, while the gates can protect information that the network has learned to retain. The resulting state changes with each utterance. The prediction made for the current line therefore uses the scene as it has unfolded to that point. The equations specify how that dependence is possible. The study supplies no separate supervision telling an individual gate to preserve the subject of the conversation or the wording of a particular setup.

What reaches the final classifier

The explicit features are added after the scene-level LSTM. They describe the current utterance and, in some cases, its relation to recent utterances. Their placement gives them a direct route to the final decision. In particular, the recurrent state is built from the line encodings, while a difference in sentence length or a change in speaker metadata can reach the classifier through the feature vector supplied at the current position.

The structural features include average word length, sentence length, and differences between the current sentence’s length and those of the five previous utterances. A line that is brief after a succession of longer turns can thus receive an input value that describes the local contrast. The network need not preserve an exact tally of previous sentence lengths in its recurrent state for the output layer to use that information.

The feature vector also records proportions of nouns, verbs, adjectives, and adverbs. These are summaries of the line’s composition by grammatical class. Because they count the categories across the utterance, they contribute a coarser description than the convolutional encoder, which processes small ordered windows of tokens. Part-of-speech tagging

Other features describe word meaning and sentiment. The authors use WordNet to obtain an antonym proportion relative to the previous utterance, giving the classifier explicit evidence about a particular form of contrast between adjacent lines. They also use SentiWordNet to obtain positive, negative, and average sentiment scores across the words. These scores summarize the affective properties assigned to individual words. The classifier learns how much to rely on those summaries when they occur alongside the contextual representation.

Speaker identity and turn position provide information about the exchange itself. The turn feature distinguishes a line at the beginning, in the middle, at the end, or alone in a turn. The speaking-rate feature uses the duration from the subtitles divided by sentence length. In the direction of the division used by the authors, it expresses time relative to length. Both features describe conditions that can matter for delivery while leaving the sound and intonation of the line outside the classifier’s inputs.

The system concatenates these high-level features with the scene-level output and passes the combined vector to a softmax layer. Softmax turns class scores into probabilities that sum to a whole. Here those probabilities concern the punchline label and its alternative. A configuration without the extra feature vector provides the corresponding comparison with a prediction based on the neural representation alone.

How the system is trained

The authors use a hidden size of 100 for the layers of both the convolutional and recurrent networks. They apply a dropout layer after the scene-level LSTM. Dropout temporarily suppresses some activations during training so that the classifier learns to operate without relying on any one fixed collection of them. They also apply L2 regularization to the softmax output layer, which penalizes large weights. These choices govern how the system learns from the training scenes and how readily it can fit particular cues found in them.

Training uses back-propagation, the procedure that carries information about prediction error back through the learned computations so their parameters can be adjusted. The authors treat each scene as a training unit. That preserves the ordered conversation within the unit used for learning. At utterances where the output is wrong, the training signal can affect the final classifier as well as the earlier stages that produced its input.

The development set serves two purposes. It is used to tune training settings, and it determines when the authors change which parts of the system continue learning. When development error first began to rise, the authors stopped updating the earlier stages and continued updating the final softmax layer alone. They report that this change improved the overall outcome. The paper names Theano as the toolkit used to implement the neural system.

Keeping the scene as the training unit and holding back complete episodes for evaluation answer different questions. The first gives the recurrence a sequence over which to learn. The second reserves unseen material for measuring the result of that learning. The development episodes sit between them, supplying evidence about training choices before the final test evaluation.

Experiments and results

Which dialogue went into each split

The corpus comes from seasons 1 to 6 of The Big Bang Theory. It comprises 135 episodes and 1589 scenes. The timing rule labeled 42.8% of its utterances as punchlines. The average interval between punchlines was 2.2 utterances. That interval describes a corpus with frequent reaction cues. The classifier is repeatedly asked to decide whether another line calls for a reaction as more of the same scene arrives.

The split is by episode. The authors assign 80% of the episodes to training and 10% each to development and test. They draw episodes from every included season in the same proportions. These percentages describe the episode split, while the authors separately give the resulting number of labeled utterances. Training contains 35,865 utterances, development contains 3904, and test contains 3903.

Holding out episodes keeps the lines of an individual episode together when separating training from evaluation. This matters for a task in which adjacent lines are dependent and an entire scene is the input sequence. A test utterance can use the preceding dialogue in its own scene, but that episode is held out from the training collection. The test is therefore a measure of prediction on new episodes within the same sitcom.

The positive class frequency refers to the whole corpus. The paper gives the utterance totals for the separate splits, while reporting the main classifier scores on the test material. Those quantities answer different questions. The overall proportion of positive examples characterizes how often the timing rule assigns a punchline label. A metric such as test recall describes how well a particular classifier retrieves the positive examples in the held-out material.

What the baselines can see

The baseline is a conditional random field, abbreviated CRF. It is a statistical sequence classifier that assigns labels in the presence of observed features. Its inclusion makes the main comparison more informative than a comparison with a method that sees only isolated lines. The baseline has access to contextual evidence through recent lexical features, explicitly defined contextual features, or both. It is implemented in CRFSuite with L2 regularization.

The lexical version uses 1-2-3gram features taken from a window containing the current utterance and the four prior utterances. Those features tell the CRF which individual words and short word sequences occur in the dialogue window. They give it access to wording on both sides of the boundary between the current line and its setup, in the sense that the current line and prior lines all contribute evidence to the prediction. The window has a specified span. The neural system instead updates a learned state over the scene.

The second CRF uses the same high-level feature vector that is attached to the full neural system. That includes comparisons with recent lines as well as properties of the current one. This baseline tests whether the information represented explicitly is enough for a competitive sequence classifier without the learned convolutional and recurrent representations. The third CRF receives the lexical and high-level features together.

The neural configurations address two other questions. One removes the high-level vector while retaining the line and scene encoders. It shows what the neural sequence can achieve before those explicit measurements are added. The other changes the utterance encoder from a CNN to an LSTM while retaining the same types of input features and the scene-level recurrence. That substitution tests the choice of line encoder within the larger architecture.

How to read the scores

Accuracy measures the share of all utterances assigned the correct label. It counts correct predictions on lines without a laughter cue as well as those on lines with one. Precision focuses on the predicted punchlines and asks what share were followed by the labeled reaction. Recall focuses on the labeled punchlines and asks what share the system found. F-score combines precision and recall as a harmonic mean, so a configuration generally needs to do well on both to achieve a strong F-score.

A false positive occurs when the classifier predicts a punchline for an utterance with no corresponding positive label. A false negative occurs when it misses an utterance marked as a punchline. These errors would have different consequences in the motivating application. The first could prompt an ill-timed reaction, and the second could leave a joke unacknowledged. Precision and recall show how the settings trade those errors, even when their overall accuracies are similar.

The paper reports the aggregate scores for each configuration. These scores establish a basis for comparing the settings at the predictions that were evaluated. They give a less detailed account of the individual decisions. For instance, they do not tell the reader whether two classifiers miss the same lines or retrieve different varieties of punchline.

Where the full system leads

Punchline F-score on held-out Big Bang Theory episodes

The scene LSTM with high-level features has the highest F-score.

Punchline F-score on held-out Big Bang Theory episodesCRF with n-grams: 50.2CRF with n-grams50.2CRF with high-level features: 56.0CRF with high-level features56.0CRF with n-grams and high-level features: 58.1CRF with n-grams and high-level features58.1Scene LSTM with CNN utterance encoder: 57.6Scene LSTM with CNN utterance encoder57.6Scene LSTM with CNN encoder and high-level features (this paper): 62.9Scene LSTM with CNN encoder andhigh-level features (this paper)62.9
The numbers
System or settingF-score %
CRF with n-grams50.2
CRF with high-level features56.0
CRF with n-grams and high-level features58.1
Scene LSTM with CNN utterance encoder57.6
Scene LSTM with CNN encoder and high-level features (this paper)62.9

The complete CNN–LSTM classifier has the highest test accuracy, 70.0%, and the highest F-score, 62.9%. Its precision is 66.7% and its recall is 59.4%. The CRF with combined features has the best F-score among the baselines, 58.1%, with accuracy of 65.9%, precision of 61.2%, and recall of 55.3%. Against that CRF, the complete neural system retrieves a larger proportion of labeled punchlines and makes a more reliable positive prediction when it labels a line a punchline.

The CRF with high-level features alone offers a different comparison. It achieves 67.8% accuracy, 67.5% precision, 47.8% recall, and a 56.0% F-score. Its precision is the highest of the configurations in the main experiment. The complete neural classifier has substantially higher recall, which explains why its F-score leads even though its precision is lower. The high-level CRF is therefore a stronger baseline for the reliability of positive predictions than its F-score rank might suggest.

The n-gram CRF has 61.8% accuracy, 56.8% precision, 45.1% recall, and a 50.2% F-score. Among the CRFs, the combination of lexical and high-level features retrieves the most labeled punchlines. It also gives up precision relative to the high-level-only setting. The test results distinguish the effect of adding lexical evidence to a feature-rich classifier from the performance of using that lexical evidence on its own.

The neural system without the high-level features has 63.1% accuracy, 56.7% precision, 58.7% recall, and a 57.6% F-score. Its recall already exceeds that of the combined-feature CRF. Its precision is lower and its F-score is also lower. The complete system preserves the recall advantage while producing more reliable punchline predictions. The ranking consequently depends on whether the comparison concerns retrieval of punchlines, the reliability of positive predictions, or a measure that balances them.

The choice of utterance encoder

The specific replacement tested in the second experiment is at the word-to-utterance stage. In one setting a CNN encodes each line, and in the other an LSTM reads across that line to encode it. A separate scene-level LSTM still provides context in both cases. The input features are retained, so the experiment asks how the alternative encoders use the available information about the words in a line.

Test punchline recall by utterance encoder on The Big Bang Theory

The convolutional utterance encoder retrieves more of the labeled punchlines.

Test punchline recall by utterance encoder on The Big Bang TheoryLSTM utterance encoder: 53.4LSTM utterance encoder53.4CNN utterance encoder (this paper): 59.4CNN utterance encoder (this paper)59.4
The numbers
System or settingrecall %
LSTM utterance encoder53.4
CNN utterance encoder (this paper)59.4

With the LSTM utterance encoder, test accuracy is 68.4%, precision is 66.2%, recall is 53.4%, and F-score is 59.1%. With the CNN, those values are 70.0% accuracy, 66.7% precision, 59.4% recall, and a 62.9% F-score. The differences in precision are comparatively small, while the CNN retrieves more positive examples. That makes recall the most informative score for seeing how the substitution changed the result.

The authors also report that the CNN took considerably less time to train. They suggest that its relative simplicity might suit the amount of data available. The runtime claim is qualitative, and the data-size explanation is an interpretation. In the tested configuration, the measured result is that convolution was the more effective of the two line encoders, while an LSTM remained the mechanism for integrating the sequence of utterances.

What the ablations show

What the explicit features contribute

Removing the high-level vector gives the clearest feature ablation. The line encoder and scene-level LSTM still supply a learned representation for each prediction. In that setting, test recall is 58.7% and precision is 56.7%. Adding the high-level information brings recall to 59.4% and precision to 66.7%. Most of the change visible in those two scores therefore concerns the reliability of positive predictions. The system already retrieves many labeled punchlines through the neural representation, and the added features help discriminate among the lines it might label as funny.

Several kinds of information arrive together in this experiment. The support for a speaker-specific pattern, a contrast with the last line, a turn closing, or a change in sentence length all enters through the same addition. The result establishes the value of supplying the feature vector jointly. There are no separate removal results for its components, so the experiment leaves open whether a small subset accounts for most of the gain or different features help on different scenes.

The comparison also shows why it matters to give the baseline those features. A system using them within a CRF reaches 67.5% precision. The explicit descriptions of the language and dialogue already provide enough evidence to produce a selective punchline classifier. The benefit of the complete architecture is that high precision is accompanied by greater coverage of the labeled reactions, as measured by recall.

What a fixed lexical window contributes

The CRF comparisons isolate the choice of feature inventory within the baseline family. Adding lexical window features to the high-level CRF raises recall from 47.8% to 55.3%. Precision moves from 67.5% to 61.2%. Recent wording therefore helps the baseline identify positive examples that the explicit summaries miss, while adding predictions on some lines with no laughter label. The combined feature setting has the highest CRF F-score despite the lower precision.

The authors interpret the result in terms of reuse across contexts. A short expression can help identify a punchline in one exchange and occur as ordinary conversation in another. A classifier that relies on those expressions can mistake the latter occurrence for the former. Their proposed explanation for the full neural system’s better balance is that convolution gives it a richer representation of the current wording and recurrence puts that representation in relation to the earlier exchange.

The precision and recall figures support a difference in the systems’ aggregate behavior. For the combined CRF and full neural system, the neural configuration has higher recall and higher precision. The paper does not trace the false positives individually to show that each one was resolved by remembered setup material. The interpretation is plausible given how the architecture is built and how the results move. It remains possible that differences in the utterance representations account for part of the advantage.

What the encoder substitution isolates

The CNN-to-LSTM substitution compares two ways of summarizing words within a line. It keeps the scene-level memory in place. The result therefore shows that the architecture benefits from the convolutional encoder as the source of the utterance vectors under the conditions of the experiment. It does not compare recurrent and convolutional processing as interchangeable ways of representing a whole conversation.

Max pooling gives the convolutional encoder a direct way to retain a strong local feature wherever it occurs in the utterance. A recurrent utterance encoder offers a different path for integrating the word sequence. Either can supply a fixed-size vector to the higher level. The reported outcome says that the particular convolutional path worked better here, especially for recall. The authors’ suggestion that it benefits from the size of the corpus is a possible explanation, since the paper compares the encoders on this corpus and supplies no experiment across training-set sizes.

The substitution also clarifies why the name of the overall system can be easy to misread. The choice of a CNN at the lower level and an LSTM at the upper level is a result about division of labor. The CNN handles local patterns in tokens, and the upper LSTM carries context across lines. When the lower level changes, the quality of the information arriving at the upper level changes even though the upper level still has the same kind of memory.

How much the comparisons establish about setup

The baseline window and the neural scene state are two ways of giving the classifier a past. They differ in the input representations and in the mechanism for using earlier utterances. The neural setting also has a learned utterance encoder. The main comparison thus supports the full design as a way to predict the labels, with several changes contributing to the result. It does not isolate the incremental value of gated recurrence with all the other computations held fixed.

The paper’s example makes the setup hypothesis readable to a human observer. Its evaluation shows that the architecture designed around the hypothesis performs better on the overall task. Establishing which earlier lines the system actually relies on would require an analysis such as removing specific turns and examining how the same current utterance is classified. There is no such intervention reported. The setup–punchline relation gives a motivation for the architecture and an interpretation of its performance, while the reported metric measures prediction of the laughter-derived label.

Limitations

Limits the authors identify

The authors point first to the relationship between production choices and audience laughter. A show can add laughter to encourage a response to a weak joke. It can also add it to maintain an amused atmosphere through a stretch with fewer jokes. For these cases, the training target records how the scene was presented. A classifier that predicts the cue correctly may have recognized a likely point for the show to place laughter, whether or not a viewer would independently have found the line funny.

This problem affects both what is learned and how it is measured. If some weak jokes receive added laughter, the classifier is rewarded for learning properties shared by those lines and stronger punchlines. If an utterance is genuinely amusing but has no detected cue in the specified interval, the classifier is rewarded for the alternative label. The authors identify the production issue directly. The implications follow from the fact that the same timing rule supplies labels to the training and evaluation sets.

The authors also treat the choice of lower-level encoder as open. They suggest that a larger corpus could support a different result and propose considering deeper or bidirectional recurrent line encoders. Bidirectional encoding would let that stage use the wording on both sides of a token within its utterance. The variants are proposed as future comparisons, so the measured advantage of the CNN applies to the alternative they tested.

The intended application remains future work. The paper proposes collecting humorous interactions through a virtual agent and adapting the approach to those interactions. A television scene has scripted dialogue and a production soundtrack. The proposed collection would allow the researchers to study the target in the setting where they want their system to respond. The sitcom experiment gives them a way to investigate the architecture before that collection exists.

What follows from the labeling setup

There is also an attribution question even when the laughter timestamp is accurate. The labeling rule attaches the cue to a line by temporal proximity. An audience reaction can build across several lines, as the paper’s example itself suggests. The line nearest the reaction can be a natural point to assign the label and still depend on several preceding contributions. The binary label collapses that dependence into a decision about one position in a sequence.

The utterances assigned the alternative label are correspondingly heterogeneous. Some may prepare for a later joke. Others may carry the ordinary business of the scene or occur between reactions without supplying information needed for the next one. Calling them setup expresses the paper’s working view of the surrounding dialogue. The corpus labels give no separate annotation that identifies which of them is a setup in the narrower sense of an utterance that helps bring about a particular punchline.

The audio procedure creates a further boundary on interpretation. The detector supplies laughter timestamps after audio processing, and the classification target is determined by alignment to those timestamps. The paper gives no independent agreement measure comparing those derived labels with a set of human judgments about humor. The reported prediction scores therefore apply to the rule-based labels. Their relationship to agreement among different listeners is an open empirical question.

The fixed timing threshold also gives the task a specific definition of when a cue belongs to a line. The study reports the chosen window, while giving no comparison across alternative windows. The relative merits of the classifiers are measured against a single set of assignments. How sensitive the rankings would be to a different attribution rule remains unknown.

What generalizes beyond an episode

The episode-level split provides a meaningful check on new material from the same show. The training and test collections can still share characters, speaking habits, and conventions about how scenes are written and how laughter is placed. Speaker identity is also an explicit input. If some characters deliver punchlines at different rates or tend to occupy different roles in an exchange, the classifier can learn to use those patterns. That would be legitimate evidence for the sitcom task, while a new cast would present a different setting.

The paper does not hold out an entire show, a group of characters, or a different conversational genre. Its results therefore give no comparative estimate of how much performance would carry over under those changes. Drawing from the same seasons across the splits keeps the evaluation close to the training distribution. It leaves unanswered how well the learned features would handle a setting with a different rhythm, different speakers, or no convention of regularly inserting audience reactions.

The utterance boundaries, speaker identities, and scene divisions also come from resources available for the show. In a live interaction, acquiring those inputs is part of the application problem. Even the current line’s duration, used in the speaking-rate feature, is known once the utterance has been timed. The experiment concerns labeling the lines with those inputs available. It supplies no measurement of how quickly the system could react in a live exchange or how robustly it would work with imperfect boundaries.

The soundtrack’s use in constructing labels is distinct from the information available at prediction time. The system uses subtitle duration, text, and dialogue features. It does not classify the line from a representation of voice quality, pauses in the performance, or visual action. The bar scene illustrates how a reader can infer a setting from the exchange. A cue that depends on what an actor is doing or how an otherwise ordinary line is delivered falls outside what the presented inputs can directly represent.

What the scores establish about the architecture

The paper reports aggregate results for its configurations on the held-out test set. It gives no run-to-run variation or uncertainty intervals for those scores. The observed ordering is therefore the ordering for the reported experiment. The results do not quantify how stable a smaller difference, such as the precision comparison between the utterance encoders, would be across different episode splits or training runs.

The mechanistic interpretation has a similar scope. The cell equations define a way to retain and discard information, but the evaluation does not identify what a particular hidden state stores. There is no analysis showing which previous utterance caused a successful change in a prediction, nor a same-architecture comparison in which earlier dialogue is removed. The results show that a system with ordered scene context and the chosen line encoder does well at predicting the labels. They leave the roles of specific setup cues unresolved.

Finally, predicting a reaction and giving an appropriate response are distinct tasks. The experiment evaluates the former with utterance labels and reports precision and recall. It does not measure whether a robot’s response would feel well timed, whether a user would welcome it, or whether it would make a conversation feel more natural. Those questions explain the authors’ interest in collecting interactions designed for the application.

What came after

The authors’ proposed extension was to collect humorous human–robot exchanges through a virtual agent and use them to adapt the predictor. In the sitcom experiment, the soundtrack stands in for an expected response. An interaction corpus would bring the task closer to the human behavior the authors wanted a machine to recognize. The paper presents that collection as future work and gives no results from it.

A later work that cites Bertero and Fung addresses transfer learning for humor detection. The topic shifts attention towards reuse of what a system learns across settings, a relevant question for a study whose training and test episodes come from the same sitcom. The citation establishes the connection to the earlier work. Whether the later study reused the sitcom data, adapted its division between utterance and scene encoding, or compared against its results is unspecified. Arora’s work on transfer learning for humor detection

Cite

Cite as Dario Bertero and Pascale Fung. 2016. A Long Short-Term Memory Framework for Predicting Humor in Dialogues. Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/n16-1016

@inproceedings{bertero2016long,
  title = {{A Long Short-Term Memory Framework for Predicting Humor in Dialogues}},
  author = {Dario Bertero and Pascale Fung},
  booktitle = {Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies},
  year = {2016},
  doi = {10.18653/v1/n16-1016},
  url = {https://doi.org/10.18653/v1/n16-1016}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/bertero-2016-long-short-term-memory-framework/