---
title: "Is This a Joke? Detecting Humor in Spanish Tweets — Castro 2016"
description: "A study of humor detection in Spanish tweets that uses readers’ judgments to label jokes and tests how well a classifier can recognize them."
canonical: "https://research.elamur.ai/free/en/papers/castro-2016-is-this-joke-detecting-humor/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/castro-2016-is-this-joke-detecting-humor/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2016](https://md.research.elamur.ai/free/en/papers/2016/) / Is This a Joke? Detecting Humor in Spanish Tweets

# Is This a Joke? Detecting Humor in Spanish Tweets

Paper · 2016 · Santiago Castro, Matías Cubero, Diego Garat et al.

**Authors:** [Santiago Castro](https://md.research.elamur.ai/free/en/authors/santiago-castro/), Matías Cubero, Diego Garat and [Guillermo Moncecchi](https://md.research.elamur.ai/free/en/authors/guillermo-moncecchi/) · **Year:** 2016 · **Venue:** Lecture notes in computer science · **Licence:** [arXiv — non-exclusive license to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

Lecture notes in computer science · [licence](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

- [DOI 10.1007/978-3-319-47955-2_12](https://doi.org/10.1007/978-3-319-47955-2_12)
- [arXiv 1703.09527](https://arxiv.org/abs/1703.09527)

## Summary

A joke account can post a joke, ask people to follow it, or use its audience to draw attention to a cause. The account’s purpose gives a clue about what an individual post is doing, but the clue needs checking. The authors study how to tell whether a short Spanish tweet is humorous when readers are free to make up their own minds about what qualifies. The task is a form of [text classification](https://md.research.elamur.ai/free/en/concepts/text-classification/).

The authors collected 16,488 tweets from accounts found through a search for jokes and 22,875 from accounts that posted news, reflections, or curious facts. They reviewed samples from the latter group and assigned those accounts’ tweets the nonhumorous label. For the joke accounts, volunteers using a website or an Android app could rate a tweet’s humor, mark it as nonhumorous, or skip it. The authors retained 33,531 annotations after filtering. They used the share of humorous votes to turn the ratings into categories and kept 5,952 tweets from the joke accounts as positive examples. The agreement measurements show that readers’ judgments sometimes diverged.

The detector uses signals such as dialogue, exclamations, words from hand-built dictionaries, and vocabulary associated with joke categories. The authors used 80% of the classification data for training and set aside 20% for evaluation. On that test set, a support vector machine performed best among the classifiers the authors tried. Its precision of 83.6% measures how often a tweet flagged as humorous carried the humorous label. Its recall of 68.9% measures how frequently the detector found tweets carrying that label. The corresponding F₁ score was 75.5%, and overall accuracy was 92.5%. The classifier outperformed a word-based baseline and a baseline that always chose the more common, nonhumorous label.

The performance figures describe a particular collection of tweets and the procedure that turned them into a classification task. The authors emphasize that the corpus covers a limited variety of humor. The source choices also matter to interpretation. The positive examples came from joke accounts and passed a reader-vote threshold, while the negative examples used for classification came from accounts with other purposes. The experiment establishes that linguistic cues can help recover these labels. It leaves open how well the same cues would distinguish jokes from ordinary posts within a joke account, or across a broader range of Spanish writing.

## Deep dive: Is This a Joke? Detecting Humor in Spanish Tweets

A study of humor detection in Spanish tweets that uses readers’ judgments to label jokes and tests how well a classifier can recognize them. · about 32 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### Deciding what counts as a joke

A short text can be perfectly easy to read and still leave its purpose in doubt. A reader might take an exaggerated statement as a claim, a complaint, or a joke. The authors place humor detection among the tasks that could help a system deal with that distinction. They suggest using a detector to find funny posts about a trending subject, look for humorous responses to comments, or help decide whether a span of text should be taken seriously. They also see recognition as a possible step towards learning what makes a joke work well enough to generate one.

The paper takes a narrower question into the experiment. Given a Spanish tweet, can a classifier decide whether the tweet belongs in the humorous category? The platform’s length constraint, up to 140 characters in the setting the authors studied, helps define the unit of analysis. A long text may include a humorous passage among passages doing other things. The authors treat a tweet as a whole and assign the whole message a category. They also frame the task around humor expressed in the text, while allowing for the contextual information a reader brings to an interpretation.

That framing makes it possible to collect judgments at the level the classifier will use. It leaves a harder question about the standard for those judgments. The authors discuss humor as a subject of psychological, cognitive, and linguistic inquiry and describe computational work on recognizing and generating it as still developing. The difficulty is partly that theories of humor identify different things to look for. Some concern the relationship between participants, some concern tension and release, and some concern the way a text supports apparently incompatible readings. Choosing any of these accounts as the annotation rule would give readers a particular theory to apply.

The authors instead give annotators a practical decision. A reader sees a tweet and indicates whether it is humorous and, if so, how funny it seems. This choice makes personal judgment part of the study’s measurement. Readers can notice an attempted joke and still differ in what they do with it. The ratings help expose that variation, and the later voting rule specifies how much support a positive example needs. The ratings are an instance of [linguistic annotation](https://md.research.elamur.ai/free/en/concepts/annotation/).

#### How a theory becomes a detectable cue

The paper uses a short exchange to show how several accounts of humor can apply to the same text. A speaker makes a sweeping claim about what is possible. The reply challenges the speaker to reach their back with a knee, treating encouragement as a literal statement about physical ability. A reader can follow the exchange with ordinary knowledge of what the body can do and an awareness that claims of this kind frequently express a general attitude.

From the perspective of superiority theory, the reply puts the optimistic speaker on the losing side of a dispute. The reader can take pleasure in seeing a confident claim defeated. From the perspective of relief theory, laughter can discharge tension, which the paper associates in this case with talk about the limits of life and possibility. An incongruity account draws attention to the change in interpretation. A statement that sounds like encouragement is answered as though its author had promised that any physical action could be done.

The paper also describes theories based on conflicting scripts. A script is a way to organize what a text is about and what to expect within that situation. Two scripts can draw support from the same text while bringing opposing expectations. Categories such as ordinary and abnormal give an idea of the kinds of opposition the paper has in mind. In a computational feature, this broad theory might motivate a search for an observable detail, such as words with opposite meanings. The presence of an antonym pair is straightforward to count. Establishing which scripts a reader inferred would call for more evidence.

The distinction between an explanation and a cue runs through the study. Adult slang, for example, is a candidate feature because prior work associates it with jokes, and relief theory gives a reason to investigate language connected to taboo subjects. A classifier can count occurrences from a list without representing the tension a reader might feel. A dialogue indicator can register the organization of the exchange without identifying the utterance that changes its interpretation. The experimental question is whether cues of this kind help distinguish the labeled groups.

#### What earlier detectors contributed

The authors report finding no previous automatic humor detector for Spanish in their search of the literature. They describe earlier work on [English](https://md.research.elamur.ai/free/en/topics/english/) one-liners, short texts of about fifteen words collected from the internet. Those projects used labeled examples to teach classifiers to distinguish jokes from comparison material. The comparison texts included, depending on the study, material from the British National Corpus, proverbs, and Reuters headlines.

A one-liner and a short tweet both give the system a compact piece of text to classify. Their settings differ in what the collection procedure can tell the classifier. An internet joke placed alongside a headline offers contrasts in subject and language as well as humor. A proverb offers a different test because it can also be compact, memorable, and figurative. The choice of comparison material therefore helps define what success in an experiment amounts to. The Spanish study carries this choice into a setting where both groups consist of tweets, with accounts chosen for the kinds of things they post.

The features surveyed in the paper give several ways to approach a short text. Alliteration concerns repeated speech sounds. Its inclusion reflects an interest in the sound and structure of jokes alongside their subject matter. A list of keywords can capture topics or expressions that appear often in the joke material. Prior work cited by the authors gives animals and lawyers as examples of topics that might supply useful words. Such a list can help distinguish collections even when the same word also appears in ordinary writing.

Other features concern how a text presents people or attitudes. References to a speaker, a listener, or another person can mark a scene organized around people. Dialogue is one way such a scene can take shape in a short joke. Negative language provides a different kind of signal. The paper distinguishes grammatical negation from vocabulary with negative associations and from words connected to stressful subjects. Counting the Spanish word for *no* is a feasible way to represent negation, but it captures only part of the broader category described in the earlier work.

Ambiguity can be approached through words or through sentence structure. A word with several senses increases the number of possible readings a system might consider. A sentence with several grammatical analyses presents a structural counterpart. Counting possible meanings or parses gives a proxy for ambiguity. The count by itself leaves open which reading a person initially adopts, which alternative the joke evokes, and whether the difference matters to the effect. This is where a feature designed for classification meets questions in [lexical semantics](https://md.research.elamur.ai/free/en/concepts/lexical-semantics/).

Another proposal in the earlier research uses how surprising a text is to a system trained on narrative writing. The measure, perplexity, summarizes the probabilities assigned to the items in a sample. Earlier work described in the paper found higher perplexity for humorous texts. That observation provides a reason to look at unexpected wording and combinations of words. The Spanish study draws on the survey to design its own inventory of features and leaves perplexity among the avenues for future work.

### The method, step by step

#### Collecting tweets from different kinds of accounts

The authors first had to find enough material to supply both sides of the classification task. They searched for *chistes*, the Spanish word for jokes, to find accounts likely to contain humorous tweets. They chose accounts that posted news, reflections, and curious facts for the comparison group. The groups comprised 9 accounts each. In the comparison group, 3 accounts represented each topic, and the amounts of material from the topics were similar.

This produced 16,488 tweets from the joke accounts and 22,875 from the comparison accounts. The collection method gave the researchers a substantial pool of candidates without requiring a reviewer to search for each possible joke. It also gave them good reason to distinguish an account’s purpose from the purpose of an individual post. The paper reports finding opinion, requests intended to attract followers, and retweets supporting a cause among material from the joke accounts.

The authors checked random samples from the news, reflection, and curious-fact sources and found no humor in those samples. They then labeled the tweets from those sources nonhumorous. For the joke-account material, they sought judgments tweet by tweet. This produced two routes to a classification label. Membership in a comparison source, backed by a sample check, supplied the negative labels used in the experiment. A vote threshold applied to an individual item supplied the positive labels.

From account selection to humor classification The steps in order.

#### Turning a reader’s reaction into a vote

The authors used a website and an Android app to make the annotation task accessible. The interface showed tweets in random order and was designed to avoid duplicate presentations. It supplied no instructions defining humor. A volunteer could mark the tweet as nonhumorous, choose a humor rating between one and five, or skip the tweet. Allowing a skip gave people a way to leave an item without committing to a judgment.

The rating interface records a distinction that a yes-or-no question would lose. Different positive scores can register a difference in how amusing readers found a tweet. For the classifier in this paper, any choice on the humor scale counted as a humorous vote. The first decision was therefore whether votes supported putting the item in the humorous class. A high rating from a reader and a low positive rating from a reader both contributed to that decision. The authors point to the rating scale as material for a future experiment on how funny a tweet seems.

The study retained 33,531 annotations after filtering. The authors removed some judgments when the same label appeared in a short time within the same session. The filter paid attention to a combination of repetition and timing. The paper describes the criterion in these terms, so the retained count represents votes after that filtering step. About half of the remaining annotations marked tweets as nonhumorous. The other half were distributed approximately across the available humor ratings.

A collection of votes is different from a collection of tweets. A tweet can receive several votes, while another can receive none. The paper’s description of its annotation histogram says that most tweets got few judgments. That matters because a rule based on the share of votes can be applied to both lightly and heavily judged items. The proportion describes the judgments available for a tweet. The amount of evidence behind that proportion depends on how many judgments the tweet received.

#### From votes to the examples used for learning

The authors measured agreement with Fleiss’ kappa, a statistic that compares observed agreement with the agreement expected from the distribution of labels. Because the calculation assumes a fixed number of annotators for the items it compares, they reported it for subsets defined by annotation count. The value was 0.416 for tweets with 2 annotations and 0.325 for tweets with 6 annotations. The first calculation covers a setting with more tweets and fewer judgments per item. The other covers a setting with fewer tweets and more judgments per item.

For each tweet that had been judged, the authors used the fraction of its annotations that were humorous. A fraction at or above 0.6 qualified the tweet as positive. A fraction at or below 0.3 made it negative. Items between the cutoffs were doubtful, as were items with no annotations. The authors describe the thresholds as giving the positive side a 0.1 advantage because the tweets under consideration came from joke accounts. Their explanation treats source choice as evidence that can favor the humorous interpretation.

The doubtful category resolves a practical problem in dataset construction. Some tweets have a record of disagreement, and others lack a record of votes. Both can stay outside the binary classification sample. That keeps uncertainty visible during corpus construction while letting the learning procedure use the labels humorous and nonhumorous. A tweet in the doubtful group has a specific status in the data procedure, even though the classification task itself has no corresponding output.

The thresholding procedure identified 5,952 positive tweets from the joke accounts. The study set aside the rest of the material from those accounts for the classification experiment, including tweets whose share of humorous votes put them in the negative category. The comparison accounts supplied the classifier’s negative examples. This decision is consequential because a nonhumorous message on a joke account might share vocabulary, layout, and a habit of addressing readers with the jokes posted there. The authors observe that those negative judgments could be used in further work.

Of the classification data, 80% went to training, and the remaining 20% was set aside for evaluation later. Supervised learning uses labeled examples to find a rule that can assign labels to new inputs. Here the rule learns from the features of tweets in the training portion. The evaluation portion supplies the examples on which its predictions are scored. This kind of task is an application of [machine learning](https://md.research.elamur.ai/free/en/concepts/machine-learning/).

#### Representing a tweet as measurements

The authors used FreeLing to split tweet text into units that the features could process. For a dictionary feature, the system needs to identify the units that can match dictionary entries. For an upper-case feature, it needs to locate the words and inspect their case. Several feature values can then describe the same tweet. Together they form a representation in which one entry can convey the presence of dialogue, another the number of links, and another the relative frequency of words found in a list. This begins with [tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/).

The adult-slang feature uses a dictionary containing 132 words. The authors assembled it by starting with a seed of 21 words and enlarging the list through bootstrapping, an approach in which an initial set supplies examples for finding more entries. The paper gives the following rule for computing dictionary-lookup features.

```
featureValue(tweet) = |tweet ∩ dictionary| / √|tweet|
```

`featureValue(tweet)` is the resulting feature score. `tweet` denotes the token collection from the message, and `dictionary` denotes the collection of entries against which those tokens are checked. `∩` means multiset intersection, where token multiplicities matter to the matching operation. The vertical bars `| |` give the size of the enclosed collection. The numerator measures the size of the intersection, and `|tweet|` gives the number of tokens in the tweet. `√` takes the square root, `/` divides the overlap count by that quantity, and `=` states the value assigned by the rule.

The square root defines how the measure responds to length. For a fixed number of matches, additional tokens lower the feature value. The use of the square root makes that length adjustment weaker than division by the full token count. The result expresses how strongly the dictionary appears in the tweet under the authors’ chosen scaling. It is an input to the classification procedure. Knowing its value would tell a reader something about the inventory of words present, while the classifier combines it with other measurements to assign a label.

Animal names form a separate handcrafted list with 103 entries. The authors included typical typing errors and grammatical mistakes, anticipating that a tweet could refer to an animal in a form that would miss a standard dictionary lookup. They also assembled a list of 43 words they judged common in jokes. These lists distinguish targeted vocabulary from general textual statistics. An animal reference and an occurrence of adult slang are both dictionary matches, but their counts convey information about different sets of words.

The authors also represented how unusual a tweet’s words were with respect to dictionary coverage. The out-of-vocabulary features tracked relative counts of words unrecognized under four dictionary arrangements. The arrangements used FreeLing alone, FreeLing with Google, FreeLing with Wiktionary, and Wiktionary alone. A word counted as unrecognized under one arrangement can be covered by another. Retaining these as separate feature values makes the coverage of each resource relevant to what the classifier sees. Such counts can reflect unusual spelling or vocabulary as well as gaps in the lookup resources.

#### Measuring dialogue, expression, and the form of tweets

The dialogue feature indicates whether a tweet is a dialogue. The question-and-answer feature focuses more specifically on questions and answers occurring in sequence. The distinction matters for the exchange the paper discusses. The text can represent someone responding to someone else even if the setup is a statement. A sequence of questions and answers supplies a more particular structure. Either measurement can be calculated at the level of the tweet and passed to the same classifier.

Features for first and second person aim to register language organized around a speaker and an addressee. The paper describes using clues from verb conjugations and from associated forms of nouns and adjectives. In its discussion of Spanish forms, the authors note the expression of gender and number in noun and adjective endings. These features are intended to capture some of the grammatical evidence behind people-centered writing. The paper describes their purpose without specifying a complete procedure for recovering who plays each part in a dialogue.

Some of the remaining signals concern visible formatting. The authors counted exclamation marks relative to tweet size and measured the relative amount of fully upper-case words. These features record different forms of emphasis. The classifier also receives counts of hashtags and links. The authors suspected that more hashtags might be associated with informality and, through that, with humor. The link count separately captures a convention that can accompany many kinds of posts. Its association with a label is left to learning from the corpus.

The candidate inventory also included a relative count of antonym pairs. For this feature the authors used WordNet’s antonymy relations together with Spanish coverage from the Multilingual Central Repository. A further feature counted occurrences of the word *no* relative to tweet size, and another measured the relative count of non-Spanish words. The authors removed these features in the course of feature selection. The method therefore includes both the mechanics of turning a hypothesis into a measurement and an empirical step that decides which measurements to retain.

#### Using another classification task as a feature

The feature called topic distance adds an indirect source of evidence. It asks how close the vocabulary of a tweet appears to a category of jokes on Chistes.com or to a sentence from Wikipedia in Wikicorpus. The authors use a bag-of-words representation for this stage. A bag of words represents vocabulary occurrences while setting aside their order. A procedure using that representation can learn that a collection favors certain words, even though it cannot recover where a joke sets up and resolves an expectation.

Multinomial naïve Bayes provides the classification technique for this feature. It uses word occurrence counts as evidence for categories. The output serves as a topic-related clue in the main humor classification task. A tweet whose vocabulary resembles a joke category supplies a different kind of evidence from a tweet whose vocabulary resembles Wikipedia sentences. Similarity in that sense can operate alongside evidence about dialogue, punctuation, and the other features.

This stage and the word-based baseline serve distinct roles in the experiment. Topic distance is an input to the feature-based classifiers, informed by joke categories and Wikipedia material. The baseline uses a bag of words and multinomial naïve Bayes to tackle the final binary task directly. A comparison between the baseline and the full feature-based approach can speak to the performance of those approaches as packages. It does not identify the separate contribution of the topic-distance feature. A controlled comparison would need to vary that feature while keeping the other relevant choices fixed.

#### From the feature inventory to a prediction

The authors tried a support vector machine, nearest neighbors, a decision tree, and Gaussian naïve Bayes with the feature-based approach. A support vector machine seeks a boundary in the representation of the training examples that separates the classes with a margin. Nearest neighbors compares a new example with nearby training examples in the representation. A decision tree arrives at a label through successive tests of feature values. Gaussian naïve Bayes uses distributions for feature values as evidence for each class. These descriptions give the role of each technique without assuming settings the paper does not give.

The authors used recursive feature elimination to assess parts of the candidate inventory. The general procedure starts with a collection of features and repeatedly reduces it according to an estimate of their usefulness in classification. In this study it led the authors to discard the antonym, negation, and non-Spanish-word features. The paper reports the choices it made. The precise feature rankings, elimination sequence, and individual test scores are left unspecified.

The paper also identifies the code and corpus as available together through the `pghumor` repository. The description of the approach connects the two artifacts. The corpus supplies the reader judgments and text on which the task was defined. The code implements the handling of the text and its features, giving the classification experiment a concrete operational meaning.

#### The probability measure discussed in earlier work

The paper gives a formula for perplexity when it explains an earlier humor feature. Perplexity belongs to that discussion and to the paper’s suggestions for future work. The detector described above uses topic distance and the listed text features.

```
2^(−(1/n) × Σᵢ₌₁ⁿ log₂ p(xᵢ))
```

`xᵢ` is the sample item at position `i`, and `n` is the number of sample items. `p(xᵢ)` is the probability assigned to that item. `log₂` takes the logarithm in base `2`. `Σᵢ₌₁ⁿ` sums the terms from `i = 1` through `i = n`, and `1/n` divides the sum by the sample size. `×` denotes multiplication, the minus sign negates the average, and `^` raises the base `2` to the power specified by the parenthesized expression.

A sample given low probabilities yields high perplexity. The intuition in the earlier work was that a system trained on narrative text would find humorous material less predictable. This connects a broad observation about surprise to a quantitative property of a sample. It also illustrates a limit of the feature idea. A probability measure can capture unexpected language wherever it arises. To attribute that unexpectedness to humor, the comparison needs to give other departures from ordinary narrative writing room to occur.

### Experiments and results

#### What the test set represents

The authors evaluated the classifiers on the 20% of the labeled data they had reserved for that purpose, after using the 80% training portion to develop the detectors. The positive test label means a tweet from a joke account met the authors’ vote threshold. The negative label in the experiment represents the comparison material from news, reflections, and curious facts. Scoring asks how often the predicted label agrees with those labels on the held-out tweets.

The class frequencies make overall correctness a limited description of success. The paper describes the more common outcome, nonhumorous, as having a frequency of almost 83% in its account of the baseline. A rule that selects that label for every tweet can classify a large share of the examples correctly. Its behavior on the items of interest is simple. Every tweet labeled humorous is missed. It is important to read that frequency as the paper’s characterization of the baseline setting, alongside the distinct counts given for account collection and annotation. Those counts describe earlier stages and do not specify the exact class counts in the held-out set.

There was also a reason to construct a baseline that learns from words. The authors say the work was the first they knew to classify humor in Spanish and the only one on their corpus. Their learned baseline applies multinomial naïve Bayes to a bag of words. That setup can exploit a regularity such as a term being common among jokes or common among news and reflections. It offers a test of how far a direct vocabulary approach can go without separately measuring attributes such as dialogue, upper-case usage, or dictionary matches.

The majority baseline and the bag-of-words baseline answer different questions. The majority baseline shows the behavior available from class prevalence alone. The word baseline shows what the task rewards when a classifier can learn from the vocabulary of both classes. This makes the supervised comparison local to the Spanish tweet collection. The paper’s discussion of earlier English experiments supplies useful context about why a shared collection matters, but their reported scores cover other tasks.

#### What the metrics tell a reader

The main metric is F₁ for the humorous class. To understand it, start with the two kinds of mistakes the study is concerned with. A false positive is a tweet labeled nonhumorous that the classifier calls humorous. A false negative is a tweet labeled humorous that the classifier misses. In a search for jokes, the former can clutter the returned material. The latter keeps a potentially relevant tweet out of the results. The paper uses a measure intended to pay attention to both kinds of error.

Precision is the share of flagged tweets that carry the humorous label. It describes the reliability of predictions among the items returned as humorous. Recall is the share of tweets carrying the humorous label that were flagged. It describes how much of the labeled humor the detector recovered. A detector can achieve strong precision by making cautious predictions and find less humor in the process. A detector that labels more material humorous may recover more of it while returning more mistakes.

F₁ combines precision and recall through their harmonic mean. The combined value is sensitive to a weak value on either side. This property fits the experiment’s focus on recovering positive items while keeping the returned set reasonably reliable. Accuracy uses every correct prediction, with both categories contributing according to how often they occur. Its value is easier to interpret when read alongside positive-class precision and recall, especially given the frequency of the nonhumorous label.

The paper’s results table also names measures obtained by treating the nonhumorous category as the one of interest. Negative predictive value, abbreviated NPV, then plays the role of precision. It asks how often a nonhumorous prediction is right. The true negative rate, abbreviated TNR, plays the role of recall. It asks how much of the labeled nonhumorous material the classifier correctly identifies. Negative F₁ combines those views for the negative category. This makes it possible to examine performance on the comparison material without allowing its frequency to absorb all the information into a single accuracy figure.

#### The Spanish tweet results

The support vector machine produced the strongest overall results reported for the Spanish tweet test set. Its positive-class precision was 83.6%, and its positive-class recall was 68.9%. The corresponding positive-class F₁ score was 75.5%. Its accuracy over both labels was 92.5%, also the best reported for the approaches in the experiment. The two positive-class figures describe a detector whose humorous predictions were relatively reliable, with a larger share of the labeled humor missed than the precision figure alone would suggest.

The nearest-neighbors approach also outperformed the baselines. The support vector machine led the overall comparison, while the performance of nearest neighbors shows that the authors’ approach could yield a detector above the baselines with a different learning technique. The comparison involves how the techniques use the features of the training examples. A margin-based decision rule and a neighborhood-based decision rule can give different labels even when both see the same kinds of measurements.

Gaussian naïve Bayes achieved the best recall in the reported comparison. Its precision was poor, and the authors also describe poor precision for the decision tree. They regard Gaussian naïve Bayes as the better performer of those two. This changes the answer to which classifier performed best when the metric changes. For catching the largest share of tweets labeled humorous, Gaussian naïve Bayes led the approaches tried. The support vector machine led on the paper’s combined view of how much humor the classifier finds and how reliably it labels what it finds.

The paper identifies a test-set confusion matrix for the support vector machine. The matrix organizes examples by the pair of labels, one from the evaluation data and one from the classifier. Such a display makes the two kinds of mistakes visible as separate groups and provides the counts that underlie metrics such as precision and recall. The reported prose gives the support vector machine’s rates and the relative ordering of the other approaches. It leaves the numerical row-by-row comparison and the individual confusion-matrix counts unspecified.

The abstract expresses the detector’s humor precision as 84% and its recall as 69%. The conclusion gives the more detailed test values of 83.6% and 68.9%, respectively. These figures describe the same task, with the conclusion also supplying the F₁ score and accuracy. The conclusion’s figures are especially helpful when following the different questions the paper’s metrics ask. High overall correctness coexists with a detector that leaves some labeled jokes unrecovered.

#### Why the earlier accuracy figures vary by comparison set

The authors report accuracy figures from an earlier English one-liner study with several sources of negative examples. The word *accuracy* has the same general interpretation across those settings, but the classification decisions are made over different comparisons. With humorous one-liners on one side, distinguishing them from Reuters headlines gives the highest reported accuracy in that study. Replacing the negative material with proverbs or with texts from the British National Corpus changes the observed performance.

Accuracy in the earlier English one-liner study by negative-text source Accuracy was highest when the negative texts were Reuters headlines.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| Reuters headlines (this paper) | 96.85 |
| Proverbs | 84.82 |
| British National Corpus | 79.15 |

The earlier study’s accuracy was 96.85% against headlines, 84.82% against proverbs, and 79.15% against material from the British National Corpus. A separate English one-liner study reviewed by the authors reported 85.40% accuracy against British National Corpus material. Its choice of features and collection differed. These results give examples of how the observed score depends on the task constructed around the jokes. They explain the Spanish paper’s choice to evaluate against baselines run on its own corpus when drawing its main performance conclusions.

There is a parallel within the Spanish setup. All the examples are tweets, which brings the positive and negative material into the same broad format. The accounts still serve different purposes. News, reflections, and curious facts give a variety of comparison material, while the positive label requires both a particular source and approval from readers. The test result combines the difficulty of recognizing that approval with whatever distinctions the source selection leaves in the text. It establishes a point of comparison for future [evaluation and benchmarks](https://md.research.elamur.ai/free/en/topics/evaluation-benchmarks/).

### What the ablations show

#### The feature-selection evidence

The paper offers a feature-selection analysis and qualitative comparisons, with no systematic set of one-feature-at-a-time ablation scores. In recursive feature elimination, the antonym feature was associated with worse classification, and the authors dropped it. They also discarded the features for relative negation frequency and relative frequency of non-Spanish words after using the elimination procedure. These are decisions about the feature set that remained in the detector.

Antonymy is the most direct example of a feature motivated by a theory surveyed in the paper. A pair of words with opposite meanings may give evidence of semantic opposition. The incongruity in the paper’s example depends on the change from an encouraging interpretation to a literal one. Such a change can occur through context, a response, and ordinary knowledge of physical constraints. An explicit antonym lookup captures a narrower event. Its removal tells us how that lookup performed as a clue in the authors’ feature-selection analysis. A broader test of conflicting interpretations would require measurements that represent more of the exchange.

The negation feature is similarly narrow. It tracks the word *no* relative to the length of a tweet. The discussion of negativity in earlier research also includes unfavorable descriptions and subjects with negative associations. Removal of the negation feature concerns the value of the particular count in this feature set. Whether a detector could benefit from a richer account of negative language remains open. For the non-Spanish-word count, the paper also reports the decision to discard the feature. It gives no comparison scores that would reveal the size of the associated change.

An elimination result depends on the surrounding features. A cue that supplies little additional information alongside the other measurements could be more informative in a different representation. Conversely, a cue can seem helpful when it broadly tracks one of the source groups. The paper’s analysis supports the narrower inference that its detector benefited from pruning the candidate inventory. How much each retained feature contributes, and which combinations matter, remain unresolved.

#### What the comparisons reveal about behavior

The classifier comparison helps characterize the kinds of outputs the approach yields. Gaussian naïve Bayes finds the largest share of the labeled positives and has poor precision. The support vector machine gives the strongest combined outcome and the best accuracy. This is evidence of differences in prediction behavior under the chosen learning techniques. The reported test cannot attribute that behavior to one feature such as dialogue or to one feature family such as dictionary overlap.

The annotated corpus supplies another analysis, about the target the system learns. Fleiss’ kappa is 0.416 on tweets with 2 annotations and 0.325 on tweets with 6 annotations. Those figures apply to different sets of tweets defined by the judgments available for them. An interpretation in which asking more readers causes agreement to fall would need the same items under comparable sampling conditions. The comparison as reported shows that agreement varies between the subsets and that a reader-vote rule has a practical role in turning responses into usable labels.

The gap between a crowd judgment and a classifier prediction also has a procedural source. Moving the positive threshold would change which tweets are available as positive examples. Including the negative votes from joke accounts would change the pool on the other side. The paper reports a single choice of thresholds and uses negatives from the comparison accounts in the main experiment. Its classifier results are evidence about that choice. A comparison across thresholds or across sources of negatives would answer further questions about the effect of the labeling procedure.

### Limitations

#### Limits the authors identify

The authors explicitly say that the corpus represents a limited variety of humor. Features that perform well in this collection may work differently elsewhere. The corpus deliberately concentrates on posts from a small collection of joke accounts for its positive material. It makes short written jokes accessible for learning, with a consistent unit of analysis, at the cost of treating the styles and subjects available from those accounts as the range to learn from. A different collection could make another set of clues useful.

The authors frame the task around tweets that express the joke in their text and expect readers to bring the context needed to interpret it. Their assumption that a short post can be labeled as a whole helps make crowdsourcing manageable. The findings therefore concern tweet-level decisions under that assumption. They leave open the task of locating a humorous passage within a longer document or interpreting a joke whose meaning depends on information absent from the message.

The authors identify wordplay, puns, ambiguity, and perplexity as opportunities for future feature development. Dialogue and unusual vocabulary can accompany a pun, while recognizing a pun calls for identifying what expression sustains several readings and how those readings interact. The paper’s supervised task asks which label applies to the message. An analysis of the device that makes the message funny would require a target and evidence at a finer level.

Several possible extensions concern the people making the judgments. The authors suggest investigating the influence of social contexts and characteristics such as gender, age, interests, and mood. They also propose using the ratings to study how funny a tweet seems, making use of information recorded by the interface and collapsed for binary classification. Their applications include helping to find jokes and eventually generating humor. The reported experiment measures binary recognition performance, leaving those applications and the prediction of degree of funniness for future studies.

#### Limits that follow from the dataset and evaluation

The labeling routes for the classes make source and humor hard to separate. Imagine a comparison between a headline containing a link and a short exchange containing emphatic punctuation. There are grounds for distinguishing those texts that have to do with their function and layout. Some of the paper’s features can represent those distinctions. If such features contribute to the observed accuracy, their usefulness could change in a collection where jokes and ordinary messages share more source conventions. The held-out tweets test classification within the paper’s corpus, and transfer across sources remains unmeasured.

The negative tweets from joke accounts show how the researchers could ask a more focused question with material already encountered during collection. Their annotation procedure found posts that readers did not judge humorous even though they came from the same accounts as the positive material. A comparison restricted to those accounts would keep more of the context of authorship and account purpose in common. Performance in that setting remains unknown. The comparison could also have its own difficulty because messages such as requests to follow the account have recognizable conventions.

Checking random samples from the negative sources supports the initial labeling decision at the level of the sample examined. Extending the result to the rest of those sources gives the study a practical way to obtain negatives. The paper does not report individual reader votes over that comparison material. Consequently, the treatment of a borderline case depends on where it comes from. A borderline joke-account tweet can fall into the doubtful group and be left out. A tweet from a comparison account receives the source’s label.

The split is reported as a training and test division, with no account-level separation described. This matters to the scope of the 92.5% accuracy and 75.5% F₁ score for the support vector machine. Holding out tweets asks the classifier to predict labels it was not trained on for those particular messages. Holding out whole accounts would ask a further question about transfer to sources whose writing habits the system had no opportunity to encounter in training. The reported partition details establish the former test and leave the latter unmeasured.

The agreement measurements and rating scheme also set a limit on what a correct prediction means. A correct prediction reproduces the corpus label formed by the paper’s procedure. For positives, that label reflects a vote threshold over people who saw the item without a supplied definition of humor. Differences in someone’s willingness to call a tweet humorous, appreciation of an attempted joke, and judgment of its intensity can enter that process. The binary label provides a usable research target while leaving the reasons for individual votes undetermined.

Excluding doubtful cases contributes to the meaning of recall. The denominator for the reported positive recall contains test tweets labeled humorous through the construction procedure. A search over ordinary social media would also encounter under-annotated material, unfamiliar references, and cases that divide people. The study gives no measure of recall over all such potentially humorous material. Its result describes the share of labeled positives recovered on its test portion.

Finally, the feature-selection evidence is more specific than the broad language of humor theory. The experiment can show whether some computable counts are helpful to this detector. It leaves the cognitive explanation for an individual reader’s reaction open. A feature for punctuation, dialogue, or vocabulary can help because it correlates with the label. Establishing that a feature has detected the mechanism of a joke would require additional evidence about what readers interpreted and which part of the text produced the effect.

### What came after

Later citing work pursued two directions that meet different parts of this paper. One concerns a linguistic device the authors wanted to address more directly. The other concerns building data for humor recognition in a different language. The connection in each case is visible in the later paper’s research question.

The study on intentional lexical ambiguity in English puns takes up a specific kind of wordplay. Its focus is the deliberate use of an expression with several possible meanings in a pun. That gives it a narrower recognition target than the Spanish tweet study. The earlier paper surveyed counts of possible word meanings as a broad cue to humor and left direct treatment of puns and ambiguity for future work. With intentional ambiguity as the target, the relevant question becomes whether the ambiguity is doing identifiable work in the pun. The citing work pursues that question in [Detecting Intentional Lexical Ambiguity in English Puns](https://md.research.elamur.ai/free/en/papers/mikhalkova-2017-detecting-intentional-lexical-ambiguity-english/).

The Arabic study addresses the problem of obtaining a dataset for humor detection in written Arabic. The point of contact is the need to turn humor recognition into a task with examples that can be collected and evaluated. For the Spanish paper, doing that required deciding where to look for jokes, how to hear from readers, and what to do with votes that gave uncertain support. The Arabic work brings the dataset question into another language. Its scope establishes the connection to humor detection through corpus construction. The citation leaves the degree of procedural reuse open in [A Dataset for Detecting Humor in Arabic Text](https://md.research.elamur.ai/free/en/papers/alkhalifa-2022-dataset-detecting-humor-arabic-text/).

The two directions illustrate why the earlier paper’s distinction between the detector and the definition of its target matters. A study of puns can ask a precise question about a phenomenon that a general-purpose classifier might encounter among many others. A dataset study can focus on what labeled material makes an experiment possible in a particular language. The Spanish tweet paper sits at the intersection. It makes corpus construction part of the recognition problem, then measures how well a detector can reproduce the judgments that construction makes available.

## Cite

Cite as Santiago Castro, Matías Cubero, Diego Garat and Guillermo Moncecchi. 2016. Is This a Joke? Detecting Humor in Spanish Tweets. Lecture notes in computer science.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.1007/978-3-319-47955-2_12](https://doi.org/10.1007/978-3-319-47955-2_12) · [arXiv 1703.09527](https://arxiv.org/abs/1703.09527)

```bibtex
@inproceedings{castro2016is,
  title = {{Is This a Joke? Detecting Humor in Spanish Tweets}},
  author = {Santiago Castro, Matías Cubero, Diego Garat and Guillermo Moncecchi},
  booktitle = {Lecture notes in computer science},
  year = {2016},
  doi = {10.1007/978-3-319-47955-2\_12},
  eprint = {1703.09527},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1007/978-3-319-47955-2_12}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
