Abstract
Computational humor recognition often overfits to dataset-specific vocabulary, failing to capture the underlying essence of what makes text funny. This paper proposes a novel approach that treats humor as a distinct linguistic style characterized by its syntactic structure. By extracting features from constituent and dependency parsing, we demonstrate that syntactic patterns—such as the interplay between complex subordinate clauses and simple vocabulary—significantly improve humor detection models. Our results show that these content-independent features offer robust performance across diverse datasets and provide valuable linguistic insights into the structural mechanics of jokes.
Introduction
Most existing computational humor recognition models rely heavily on content-based features, such as specific word embeddings or topics. While effective within a single domain, these models often learn vocabulary differences between specific datasets (e.g., web jokes vs. news articles) rather than the universal properties of humor. This paper identifies humor as a style and explores whether content-independent syntactic structures can reliably identify humor across different contexts, thereby reducing reliance on dataset-specific artifacts.
Methodology
To capture the structural style of a sentence, we extract three primary types of syntactic features using the Stanford Parser:
- Statistics of Structural Elements: Metrics including sentence complexity, phrase length ratios (Noun, Verb, and Prepositional Phrases), and head noun modification patterns.
- Production Rules: Rules derived from constituent parsing trees (e.g.,
S -> NP VP) that capture how grammatical phrases are composed. - Dependency Relations: Features from dependency parsing (e.g.,
nsubj,aux,compound) that define the grammatical relationships between specific words.
These features are normalized and processed using a Random Forest classifier. We compare this syntactic approach against several baselines: Humor Theory driven Features (HTF), Human Centric Features (HCF), and Word2Vec embeddings.
Experimental Setup
To ensure robustness, the models were tested across three dataset combinations using a positive class of 10,200 "One-Liner" jokes and various negative classes:
- RPBN: ~10,000 non-humorous sentences from Reuters news, Proverbs, and the British National Corpus.
- CoNLL: 10,000 sentences from the OntoNotes corpus, matched for average sentence length to minimize length-bias artifacts.
- Mixed: A balanced dataset comprising 50% RPBN and 50% CoNLL for the negative class.
Linguistic Insights
The machine learning features revealed several key linguistic phenomena inherent in humor:
- Structural Complexity vs. Lexical Simplicity: Jokes frequently utilize common vocabulary but rely on complex sentence structures like subordinate clauses (
SBAR) to set up a mundane premise before delivering an unexpected punchline. - Vivid Framing: Humorous texts show a high frequency of auxiliary verbs (
aux), often tied to negation, which signals shifts in attitude or contrast. Expressiveness is further enhanced through rhetorical questions. - Conversational Tone: Jokes often mirror dialogue, featuring a high frequency of personal pronouns. This aligns with the "superiority theory" of humor, where jokes often involve interpersonal situations or social comparisons.
Key Results
Our experiments demonstrate that syntactic features provide orthogonal and highly useful information for humor detection. Adding syntactic features to the HTF baseline yielded a significant average improvement of 7.9% in accuracy and 7.2% in F1 score across all datasets.
While content-heavy baselines like Word2Vec achieve high performance, adding syntactic features still provided a measurable boost (e.g., +0.6% F1 on the CoNLL dataset). Among the syntactic features, Production Rules were found to be the most discriminative, slightly outperforming dependency relations and structural statistics.
Conclusion
While content-based models are susceptible to dataset artifacts, syntactic features offer a more robust, domain-agnostic method for humor recognition. By focusing on the stylistic markers of humor rather than semantic content, we can build models that better generalize across different linguistic contexts. Future work will continue to explore these stylistic markers to develop more sophisticated, context-aware humor detection systems.
Summary updated