Laughing Heads: Can Transformers Detect What Makes a Sentence Funny?
Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence. Main Track. Pages 3899-3905.
https://doi.org/10.24963/ijcai.2021/537
Keywords
- Natural Language Processing: Natural Language Semantics
- Natural Language Processing: Resources and Evaluation
Abstract
The automatic detection of humor poses a grand challenge for natural language processing.
Transformer-based systems have recently achieved remarkable results on this task, but they usually
(1) were evaluated in setups where serious vs humorous texts came from entirely different sources, and
(2) focused on benchmarking performance without providing insights into how the models work.
We make progress in both respects by training and analyzing transformer-based humor recognition models on a recently introduced dataset consisting of minimal pairs of aligned sentences, one serious, the other humorous.
We find that, although our aligned dataset is much harder than previous datasets, transformer-based models recognize the humorous sentence in an aligned pair with high accuracy (78\%).
In a careful error analysis, we characterize easy vs hard instances.
Finally, by analyzing attention weights, we obtain important insights into the mechanisms by which transformers recognize humor.
Most remarkably, we find clear evidence that one single attention head learns to recognize the words that make a test sentence humorous, even without access to this information at training time.
@inproceedings{ijcai2021p537,
title = {Laughing Heads: Can Transformers Detect What Makes a Sentence Funny?},
author = {Peyrard, Maxime and Borges, Beatriz and Gligorić, Kristina and West, Robert},
booktitle = {Proceedings of the Thirtieth International Joint Conference on
Artificial Intelligence, {IJCAI-21}},
publisher = {International Joint Conferences on Artificial Intelligence Organization},
editor = {Prof. Zhi-Hua Zhou},
pages = {3899--3905},
year = {2021},
month = {8},
note = {Main Track},
doi = {10.24963/ijcai.2021/537},
url = {https://doi.org/10.24963/ijcai.2021/537},
}
TY - CPAPER TI - Laughing Heads: Can Transformers Detect What Makes a Sentence Funny? AU - Peyrard, Maxime AU - Borges, Beatriz AU - Gligorić, Kristina AU - West, Robert T2 - Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI-21 PB - International Joint Conferences on Artificial Intelligence Organization PY - 2021 SP - 3899 EP - 3905 DO - 10.24963/ijcai.2021/537 UR - https://doi.org/10.24963/ijcai.2021/537 ER -Copied
Machine-readable versions of this paper, for tools and AI agents: