Elsevier

Neurocomputing

Volume 394, 21 June 2020, Pages 105-111
Neurocomputing

Humor detection via an internal and external neural network

https://doi.org/10.1016/j.neucom.2020.02.030Get rights and content

Abstract

Humor as a lubricant for daily life is frequently used in language expressions. It is usually triggered by comparisons of metaphorical scenes or misunderstandings of ambiguous words. Hence, detecting and recognizing the humor implied in text is an interesting and challenging research problem in the field of natural language processing. To understand humor, we discuss incongruity and ambiguity in detail and then propose an internal and external attention neural network (IEANN) for the humor detection task. The IEANN integrates two types of attention mechanisms to capture the incongruity and ambiguity in humor text. Meanwhile, extensive experiments are conducted on two humor datasets to test the effectiveness and robustness of our model. The experimental results show that the proposed model not only achieves state-of-the-art performance but also has better interpretability.

Introduction

Humor, as an essential element in personal communication, is one of the characteristics that define humans. Automatically detecting humor not only makes artificial intelligence more friendly to humans but also makes them appear more intelligent [1]. In recent years, the task of humor recognition has attracted increasing attention from many researchers, which aims to classify the existing text into two sets, humor or nonhumor.

Humor detection is a challenging natural language problem [2] because of the different cognition of humor definition and different characteristics of different types of humor. There are many types of humor, such as jokes, one-liners and humorous dialogs. Since a deep understanding of humor in all of its aspects is rather difficult, we focus on humor detection in the form of one-liners.

The one-liner is the type of humor that is a short sentence using a few words to convey a humorous effect. Compared to other types of humor, one-liners do not have a rich context, and they must produce a humorous effect with deliberate inconsistent parts or complex semantic information with very few words. Therefore, incongruous and ambiguous semantic expressions are often used in humor to attract the reader's attention, such as antonyms and ambiguous words. Furthermore, linguists argue that humor is often associated with several linguistic phenomena, such as mixing two disparate interpretation frames in one statement [3] or semantic and pragmatic ambiguity, which is closely related to the different meanings that a word, phrase, or sentence may produce to create humor [4]. The above two linguistic phenomena can be summarized as incongruity and ambiguity.

Incongruity is the essence of the laughable, the disconnecting of one idea from another [5]. Laughter arises from the view of two or more inconsistent, unsuitable, or incongruous parts or circumstances, considered as united in complex objects or assemblages, or as acquiring a sort of mutual relation from the peculiar manner in which the mind takes notice of them [6].

Exp 1

“A clean desk is a sign of a cluttered desk drawer.”

For example, Exp 1 contains antonyms “clean” and “cluttered”. By using a pair of words, the sentence corresponds from the former part to the latter part, which achieves the semantic incongruity of the sentence and creates the comic effect.

Ambiguity [6] in a one-liner is characterized by two or more meanings of a word, each of which leads to a different but valid interpretation. Ambiguity and humor often come together [7], and many humor studies emphasize that ambiguity is the main mechanism for producing humorous effects [8].

Exp 2

“When I am in America, I drive on the right side of the road, which is of course, the left.”

For example, the following “right” is the ambiguous word that has multiple possible meanings and creates different understandings in readers. Our intuition is that words with different numbers of meanings have different contributions to a humor sentence.

Some previous work used well-constructed features [4] to represent inconsistency and ambiguity, which required more human effort and prior knowledge of this particular task in one-liners. In addition, well-constructed features easily lead to the confusion of model generalization capability. Recently, with the advance of deep learning networks [9,10], new opportunities are appearing for humor recognition to allow end-to-end training without human intervention of feature selection. However, these methods have several shortcomings for the humor detection task. First, there is no obvious interaction between pairs of words, which makes it difficult for the model to capture incongruity in a humor sentence. Second, there is no clear reflection between ambiguous words and humor, which hampers the ability of the network to definitely model ambiguity. Finally, it is difficult to explain how the neural network captures the latent semantic features of humor. In this case, inconsistent and ambiguous situations that are commonplace in humor language may be difficult to detect with simple sequential models.

Hence, we propose a new humor detection framework, the internal and external attention neural network (IEANN), to overcome the above weaknesses of neural networks and recognize humor text. Based on the intuition of modeling incongruity and ambiguity, IEANN can not only improve classification performance but also lead to more explainable neural humor detection methods. Generally, the key idea of most neural attention mechanisms is to focus on words related to a specific category. Therefore, IEANN detects ambiguity in a sentence by focusing on ambiguous words through attention mechanisms. Meanwhile, our model can focus on the relationships between each word pair to capture incongruity within end-to-end neural networks.

In this study, our aim is to combine the effectiveness of state-of-the-art recurrent models while harnessing the intuition of incongruity and ambiguity. We propose IEANN, which models intricate similarities between each word pair and ambiguous words in a sentence. Meanwhile, we compare our model with several state-of-the-art models, including Word2Vec+HCF [1] and CNN+F+HW [9]. Experimental results on two datasets demonstrate that our model consistently outperforms the existing models. Finally, we show that our model produces interpretable attention maps that can help explain the outputs of the model. Briefly, the main contributions of this work can be summarized as follows.

  • We propose a multiple dimension attention recurrent network for humor recognition. Our model enables the neural network to focus on the incongruity and ambiguity. To the best of our knowledge, neither of the two features has been explicitly modeled in the literature.

  • Since the two above features play key roles in this task, we propose two methods for considering the contrast features and ambiguous features during attention. One method is to focus on the relationships of each word pair, and another method concatenates the ambiguous level vector into the input word vectors.

  • The experimental results show that our model can significantly improve the performance compared with several baselines, and further detailed examples verify the effectiveness of our presented model for humor detection.

Section snippets

Related work

In this section, we focus on reviewing the related approaches to humor detection. Humor is a complex linguistic phenomenon that has long fascinated both linguists and natural language processing (NLP) researchers. Across the rich history of research on humor, several theories have been addressed such as superiority/disparagement theory come from the perspective of social behavior [11], release/relief theory from psychological analysis [12], and incongruity theory from psychological cognition

Declaration of Competing Interest

We declare that we have no conflicts of interest.

Acknowledgments

This work is partially supported by grant from the National Natural Science Foundation of China (No. 61632011, 61702080, 61772103), the Fundamental Research Funds for the Central Universities (DUT18ZD102, DUT19RC(4)016), the National Key Research Development Program of China (No. 2018YFC0832101), China Postdoctoral Science Foundation (No. 2018M631788).

Xiaochao Fan was born in 1982. He received the B.S. degree in Computer Science and Technology in 2005, and the M.S. degree in Computer Application in 2014. He is currently working as a Lecturer in the School of Computer Science and Technology, Inner Xin Jiang Normal University. His research interests include sentiment analysis, text mining and bioinformatics.

References (29)

  • P.-Y. Chen et al.

    Humor recognition using deep learning

  • C.R. Gruner

    The Game of Humor: A Comprehensive Theory of Why We Laugh

    (1997)
  • J. Rutter. Stand Up as Interaction: Performance and Audience in Comedy Venues. Ph.D. Dissertation, The University of...
  • V. Raskin

    Semantic Mechanisms of Humor

    (1985)
  • Xiaochao Fan was born in 1982. He received the B.S. degree in Computer Science and Technology in 2005, and the M.S. degree in Computer Application in 2014. He is currently working as a Lecturer in the School of Computer Science and Technology, Inner Xin Jiang Normal University. His research interests include sentiment analysis, text mining and bioinformatics.

    Hongfei Lin received the B.S. degree in Mathematics from Northeastern Normal University, Changchun, China; the M.S. degree in Computer Application from Dalian University, Dalian, China; and the Ph.D. degree in Computer Software and Theory from Northeastern University in Shenyang, China in 2000.

    From 2000 to 2005, he was an Associate Professor with the School of Electronic and Information Engineering of Dalian University of Technology, Dalian, China. Since 2005, he has been a Professor with the School of Computer Science and Technology of Dalian University of Technology, Dalian, China. He founded a laboratory of information retrieval (DUTIR) in 2001. His publications run to over 150 papers, and he holds seven patents. He serves several journals as editor. His research interests include natural language processing, text mining, sentiment analysis, social computing, information retrieval, and bioinformatics.

    Professor Lin is a member of the Association for Computational Linguistics, the China Association of Artificial Intelligence, the China Computer Federation, and the Chinese Information Processing Society. He was a member of the IEEE International Conference on Bioinformatics & Biomedicine Program Committee from 2009 to 2017.

    Liang Yang received the M.S. degree from the Dalian University of Technology, Dalian, China, and the Ph.D. degree from the Dalian University of Technology, Dalian, China. He is currently an instructor with the Faculty of Electronic Information and Electrical Engineering, Dalian University of Technology. His current research interests include sentimental analysis and opinion mining.

    Yufeng Diao was born in 1987. She received the B.S. degree in Computer Science and Technology in 2009, and the M.S. degree in Computer Application in 2012. She is currently working as a Lecturer in the School of Computer Science and Technology, Inner Mongolia University for Nationalities. Her research interests include sentiment analysis and opinion mining.

    Chen Shen is working toward the Ph.D. degree in the School of Computer Science and Technology, Dalian University of Technology, China. His research interests include sentimental analysis, and opinion mining.

    Yonghe Chu received the M.S. degree in College of Computer and Information Technology, Liaoning Normal University, China, in 2017. Currently, he is working toward the Ph.D. degree in the School of Computer Science and Technology, Dalian University of Technology, China. His research interests include pattern recognition, computer vision, and machine learning.

    YanBo Zou was born in 1981. She received the B.S degree from QIQIHAR University in 2003, and the M.S. degree in Computational Physics in 2008, and the Ph.D. in Computational Physics in 2017. She is currently working as a Lecturer in the College of Physics and Electronic Engineering, Inner Xinjiang Normal University. Her research interests include text mining, computational materials science, and applied physics.

    View full text