Proceedings

Laughing Heads: Can Transformers Detect What Makes a Sentence Funny?

Download BibTeX Cite

Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence. Main Track. Pages 3899-3905.

https://doi.org/10.24963/ijcai.2021/537

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.

  1. [Attardo and Raskin, 1991] Salvatore Attardo and Victor Raskin. Script theory revis(it)ed: Joke similarity and joke representation model. Humor: International Journal of Humor Research, 1991.
  2. [Blinov et al., 2019] Vladislav Blinov, Valeria Bolotova-Baranova, and Pavel Braslavski. Large dataset and language model fun- tuning for humor recognition. In Proceedings of ACL, pages 4027-4032, Florence, Italy, jul 2019.
  3. [Cattle and Ma, 2018] Andrew Cattle and Xiaojuan Ma. Recogniz- ing humour using word associations and humour anchor extraction. In Proceedings of IJCNLP, pages 1849-1858, Santa Fe, New Mex- ico, USA, August 2018.
  4. [Chen and Soo, 2018] Peng-Yu Chen and Von-Wun Soo. Humor Recognition Using Deep Learning. In Proceedings of NAACL, pages 113-117, New Orleans, Louisiana, jun 2018.
  5. [Clark et al., 2019] Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D. Manning. What does BERT look at? an analysis of BERT's attention. In Proceeding of the ACL Workshop BlackboxNLP, pages 276-286, Florence, Italy, aug 2019.
  6. [Devlin et al., 2019] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirec- tional transformers for language understanding. In Proceedings of NAACL, pages 4171-4186, Minneapolis, Minnesota, jun 2019.
  7. [Goldwasser and Zhang, 2016] Dan Goldwasser and Xiao Zhang. Understanding satirical articles using common-sense. TACL, 4:537-549, 2016.
  8. [González-Ibáñez et al., 2011] Roberto González-Ibáñez, Smaranda Muresan, and Nina Wacholder. Identifying sarcasm in Twitter: A closer look. In Proceedings of ACL, pages 581-586, Portland, Oregon, USA, jun 2011.
  9. [Grave et al., 2018] Edouard Grave, Piotr Bojanowski, Prakhar Gupta, Armand Joulin, and Tomas Mikolov. Learning word vec- tors for 157 languages. In Proceedings of LREC, 2018.
  10. [Horvitz et al., 2020] Zachary Horvitz, Nam Do, and Michael L. Littman. Context-driven satirical news generation. In Proceedings of FLP, pages 40-50, Online, July 2020.
  11. [Hossain et al., 2019] Nabil Hossain, John Krumm, and Michael Ga- mon. "President vows to cut <taxes> hair": Dataset and analysis of creative text editing for humorous headlines. In Proceedings of ACL, pages 133-142, Minneapolis, Minnesota, jun 2019.
  12. [Hossain et al., 2020] Nabil Hossain, John Krumm, Tanvir Sajed, and Henry Kautz. Stimulating creativity with FunLines: A case study of humor generation in headlines. In Proceedings of ACL, pages 256-262, 2020.
  13. [Jain and Wallace, 2019] Sarthak Jain and Byron C. Wallace. At- tention is not Explanation. In Proceedings of NAACL, pages 3543-3556, Minneapolis, Minnesota, June 2019.
  14. [Kiddon and Brun, 2011] Chloé Kiddon and Yuriy Brun. That's what she said: Double entendre identification. In Proceedings of ACL, pages 89-94, Portland, Oregon, USA, jun 2011.
  15. [Kovaleva et al., 2019] Olga Kovaleva, Alexey Romanov, Anna Rogers, and Anna Rumshisky. Revealing the dark secrets of BERT. In EMNLP-IJCNLP, pages 4365-4374, 2019.
  16. [Mihalcea and Strapparava, 2005] Rada Mihalcea and Carlo Strap- parava. Making computers laugh: Investigations in automatic humor recognition. In Proceedings of EMNLP, 2005.
  17. [Potash et al., 2017] Peter Potash, Alexey Romanov, and Anna Rumshisky. SemEval-2017 task 6: #HashtagWars: Learning a sense of humor. In Proceedings of SemEval, pages 49-57, Van- couver, Canada, aug 2017.
  18. [Purandare and Litman, 2006] Amruta Purandare and Diane Lit- man. Humor: Prosody analysis and automatic recognition for F*R*I*E*N*D*S*. In Proceedings of EMNLP, pages 208-215, Sydney, Australia, July 2006.
  19. [Radford et al., 2019] Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. https://openai.com/ blog/better-language-models, 2019. Accessed: 2021- 01-20. Link
  20. [Raskin, 2008] Victor Raskin. The Primer of Humor Research. De Gruyter Mouton, Berlin, Boston, 2008.
  21. [Reimers and Gurevych, 2019] Nils Reimers and Iryna Gurevych. Sentence-BERT: Sentence embeddings using Siamese BERT- networks. In Proceedings of EMNLP-IJCNLP, pages 3982-3992, Hong Kong, China, nov 2019.
  22. [Reyes et al., 2013] Antonio Reyes, Paolo Rosso, and Tony Veale. A multidimensional approach for detecting irony in twitter. Lan- guage Resources and Evaluation, 47(1):239-268, March 2013.
  23. [Stock and Strapparava, 2003] Oliviero Stock and Carlo Strappar- ava. Getting serious about the development of computational humor. In Proceedings of the 18th International Joint Conference on Artificial Intelligence, page 59-64, 2003. IJCAI
  24. [Taylor and Mazlack, 2004] Julia M. Taylor and Lawrence J. Ma- zlack. Computationally recognizing wordplay in jokes. In Pro- ceedings of the Annual Meeting of the Cognitive Science Society, pages 1315-1320, 2004.
  25. [Vaswani et al., 2017] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is All you Need. In Advances in Neural Information Processing Systems 30, pages 5998-6008. 2017.
  26. [Wallace et al., 2015] Byron C. Wallace, Do Kook Choe, and Eu- gene Charniak. Sparse, contextually informed models for irony detection: Exploiting user communities, entities and sentiment. In Proceedings of ACL, pages 1035-1044, Beijing, China, jul 2015.
  27. [Weller and Seppi, 2019] Orion Weller and Kevin Seppi. Humor Detection: A Transformer Gets the Last Laugh. In Proceedings of EMNLP-IJCNLP, pages 3621-3625, Hong Kong, China, nov 2019.
  28. [West and Horvitz, 2019a] Robert West and Eric Horvitz. Reverse- engineering satire, or "paper on computational humor accepted despite making serious advances". In Proceedings of the 33rd AAAI Conference on Artificial Intelligence, pages 7265-7272, 2019.
  29. [West and Horvitz, 2019b] Robert West and Eric Horvitz. Un- fun.me dataset. https://github.com/epfl-dlab/ unfun, 2019. Accessed: 2021-01-15. Link
  30. [Wiegreffe and Pinter, 2019] Sarah Wiegreffe and Yuval Pinter. At- tention is not not explanation. In Proceedings of EMNLP, pages 11-20, Hong Kong, China, November 2019.
  31. [Yang et al., 2015] Diyi Yang, Alon Lavie, Chris Dyer, and Eduard Hovy. Humor Recognition and Humor Anchor Extraction. In Proceedings of EMNLP, pages 2367-2376, Lisbon, Portugal, sep 2015.
  32. [Zhang and Liu, 2014] Renxian Zhang and Naishi Liu. Recognizing humor on twitter. In Proceedings of the 23rd ACM International Conference on Information and Knowledge Management, page 889-898, New York, NY, USA, 2014.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards