<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Humor Detection in Spanish Tweets Using Neural Network</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Toyohashi University of Technology</institution>
          ,
          <addr-line>Toyohashi</addr-line>
          ,
          <country country="JP">Japan</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>With its linguistic, social, and psychological components, humor has long been a part of human life. Allowing computers to interpret humor has become extremely important due to its wide range of uses and growing popularity on social media platforms. While humor has long been researched from psychological, cognitive, and linguistic perspectives, computational linguistics has yet to investigate it. Our contribution to HAHA@IberLEF2021: Humor Analysis based on Human Annotation is described in this paper. We o er a deep neural network-based approach in this paper. Our research team uses multi-kernel convolution recurrent neural network model for the humor detection in tweets. We examine our method's performance and show how each component of our design contributes to its overall success.</p>
      </abstract>
      <kwd-group>
        <kwd>Humor</kwd>
        <kwd>Recurrent Neural Network</kwd>
        <kwd>Text</kwd>
        <kwd>CNN</kwd>
        <kwd>tweets</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Humor is a universal and subtle emotion that can be found all over the world.
The majority of prior research and studies on humor di culties were focused
on binary categorization or the identi cation of linguistic features. Purandare
and Litman utilized typical supervised learning classi ers to recognize hilarious
speech in a hilarious spoken dialogue as data from a famous comedy television
show [18]. Taylor and Mazlack used the methodology that was based on the
extraction of structural patterns and peculiar structure of jokes newcite [20].
Luke de Oliveira and Lainez applied recurrent neural network (RNN) and
convolutional neural networks (CNNs) to humor detection from reviews in Yelp
dataset [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
      </p>
      <p>
        Because tweets are brief and informal user-generated text that typically do
not follow grammatical standards, detecting humor in them presents particular
problems to the research community. Furthermore, tweets feature a plethora of
unique abbreviations as well as Twitter-speci c syntaxes like hashtags and
emojis. To address the challenge of humor detection, Chiruzzo et al. [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] presented a
task that focuses on detecting humor in Spanish tweets. Various subtasks related
to automated humor detection are proposed in the present HAHA assessment
campaign. In this paper, we propose a neural network method that combines
the multi-kernel convolution with the Bi-LSTM. Experimental results on given
Spanish tweets demonstrate the submitted results of our framework.
      </p>
      <p>The rest of the paper is structured as follows: Section 2 presents a summary
of previous studies. In Section 3, we introduce our proposed humor detection
framework. Section 4 includes experiments and evaluations. Some concluded
remarks of our work are described in Section 5.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Related Research</title>
      <p>
        In the related work of humor identi cation, there are a lot of work that is done
over the year which includes statistical and N-gram analysis [20], Regression
Trees [18], Word2Vec combined with K-NN Human Centric Features, and
Convolutional Neural Networks [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. When working with a limited number of
characteristics, neural networks function exceptionally e ectively. When dealing with
changing length sequences, sequence variants to prior states, as in recurrent
neural networks, can be introduced to the network. To identify jokes from non-jokes,
several humor detection algorithms include hand-crafted (typically word-based)
characteristics [
        <xref ref-type="bibr" rid="ref3">21, 12, 3, 15</xref>
        ]. Such word-based features work well when the
nonjoke dataset contains terms that are entirely distinct from the humor dataset.
According to humor theory, the sequence of words matters, because announcing
the punchline before the setup would merely lead to the discovery of the second
interpretation of the joke, causing the joke to lose its humorous component [19].
For some years, gurative language, particularly humor, has been a fruitful eld
of research in the domain of shared tasks. One of the problems provided by
gurative language, such as metaphors and irony, was discussed in Semeval-2015
Task 11 [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]: its in uence on Sentiment Analysis. Semeval-2017 Task 6 [17]
supplied participants with hilarious tweets sent to a comedy show, and asked them
to guess how the audience and producers of the show would rate the tweets.
The HAHA task was arranged by Grupo PLN-InCo at two di erent conferences:
IberEVAL 2018 [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. There was two subtasks: humor detection and prediction of
funniness score. SemEval-2021 Task 7 [11] is a newer task that combines humor
detection with o ense detection. It includes all of the subtasks from HAHA 2018
and 2019[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], plus two new ones: O ense Score Prediction and Controversial
Humor Classi cation. In [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], there were four subtasks, from which we participated
in two of them.
      </p>
    </sec>
    <sec id="sec-3">
      <title>Framework</title>
      <p>In this section, we describe the details of our proposed framework for humor
detection is Spanish tweets. Figure 1 depicts an overview of our proposed
framework.</p>
      <p>We utilize the pre-trained-word-vectors-for-spanish word embedding
purposes. The embedding matrix is fed into the embedding layer of our neural
network. We start by extracting higher-level feature sequences from the target
added tweet embeddings using multi-kernel convolution lters. These feature
sequences are supplied into the Bi-LSTM that is linked to it. Following that, we
go through each component in detail.</p>
      <p>
        Multi-kernel CNN
kernel size [
        <xref ref-type="bibr" rid="ref3 ref4 ref5">3,4,5</xref>
        ]
      </p>
      <p>Pooling Layer
Bi-LSTM Layer</p>
      <p>Dimensions = 300,</p>
      <p>Vectors=1,000,653
Feature Vector</p>
      <p>Forward
Layer</p>
      <sec id="sec-3-1">
        <title>LSTM</title>
      </sec>
      <sec id="sec-3-2">
        <title>LSTM</title>
        <p>Backward
Layer</p>
      </sec>
      <sec id="sec-3-3">
        <title>Dense Layer</title>
      </sec>
      <sec id="sec-3-4">
        <title>Results</title>
        <p>Starting with random weights, the Embedding layer in Figure 1 will learn an
embedding for all of the words in the training dataset. The initial hidden layer
of a network is de ned as this exible layer. A pre-trained model used in the
embedding layer simply required a le containing tokens and their associated
word vectors. The pre-trained word vectors for Spanish model was built using
300-dimensional word vectors. Dimensionality is a term that refers to how many
dimensions there are in anything. The Embedding matrix will have a
dimensionality of L x D, where L is the sentence length and D is the word-vector
dimension.
3.2</p>
        <p>Convolution Neural System
We use the technique given by [13] to extract higher-level features in our
multikernel convolution. The embedding matrix created in the embedding layer is
the module's input. Then, using a lter, we apply convolution on it. We use
three distinct kernel sizes, or the size of the convolution lters, to apply multiple
convolutions: 3, 4, and 5. Each lter creates the matching feature maps after
performing convolutions, and then a max-pooling function is used to build a
univariate feature vector. Finally, each kernel's feature vectors are concatenated
to create a single high-level feature vector.
3.3</p>
        <p>Bi-LSTM
Bidirectional Long Short Term Memory (Bi-LSTM) is a bidirectional variant
of LSTM seen in the center of Figure 1. Bi-LSTM combines the forward and
backward hidden layers, allowing access to both the previous and subsequent
contexts. The Bi-LSTM neural network is used to obtain a vector representation
of the input sentence that captures the semantics of the phrase e ectively. The
nal result from Bi-LSTM's output layer is formed by merging the results from
both RNN hidden layers, namely the forward and backward layers.
3.4</p>
        <p>Humor classi cation and Prediction
We get our results from the last linear layer of the model. We consider binary
cross-entropy and mean square error (mse) as the loss function in sub-task1 and
sub-task2, respectively. We use the stochastic gradient descent (SGD) to learn
the model parameter and adopt the Adam optimizer [14].</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Evaluation</title>
      <p>Dataset
The organizer provide a corpus of crowd-annotated tweets divided into three
subsets for tasks 1 and 2: training (24,000 tweets), development (4,000 tweets),
and testing (6,000 tweets). The annotation has a voting system in which users
can choose from six di erent choices. The tweet is either not funny or funny,
with a score ranging from one (not funny) to ve (very hilarious) (excellent).</p>
      <p>
        To prepare the data, we eliminated stop words using NLTK's standard
stoplist, eliminated special characters, and performed hashtag segmentation using
the hashtag segmentation tool [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. The xed length of a sentence was set in the
beginning of embedding technique.
4.2
      </p>
      <p>
        Model Con guration
In the following, we describe the set of parameters that we have used in our
framework during experiments. We used one embedding model to initialize the
word embeddings in the embedding layer. The embedding model has 300-dimensional
with 1,000,653 vectors. It is trained on Spanish Billion Word Corpus which has
the size of 1.4 billion words [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. For the multi-kernel convolution, we employed
3 kernel sizes (3,4,5), and the number of lters was set to 36. The framework
which we used to design our model was based on TensorFlow [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and training of
our model is done on a GPU [16] to capture the bene t from the e ciency of
parallel computation of tensors. We trained our model for a max of 50 epochs
with a batch size of 64 and an initial learning rate of 0.001 by Adam optimizer.
In this paper, we reported the results based on these settings. Unless otherwise
stated, default settings were used for the other parameters.
4.3
      </p>
      <p>Results and Analysis
Our target is to classify the tweets into humorous or not humorous from Spanish
tweets. In Table 1, at rst we reported the results of sub-task1 and sub-task2
based on a Naive Bayes with t df features and SVM regression with t df features,
respectively. Next, we reported the results of our proposed framework that were
submitted in the competition. After the competition, some parameters were
changed to check the betterment of results, and we found that we could improve
our results so far to 77.453 percent F1 for sub-task1, and 0.6977 RMSE error for
sub-task2, although these results could not be submitted to the competition.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>Our technique for HAHA@IberLEF2021: Humor Analysis based on Human
Annotation Forum was described in this article. Humor detection is a di cult
process. We used deep learning techniques to try to solve the problem. We ran
some tests with other models, such as a basic regression model and a
multilayer perceptron model, however the model described in this paper was the one
that produced the best results. In a summary, our uni ed framework's key
contribution is that it successfully learns contextual information, which improves
comedy detection performance. We want to leverage external data to generalize
our model for comedy identi cation in the same region in the future.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>This research was supported by the Japan International Cooperation Agency {
JICA under Innovative Asia program.
11. Gupta, A., Pal, A., Khurana, B., Tyagi, L., Modi, A.: Humor@iitk at semeval-2021
task 7: Large language models for quantifying humor and o ensiveness (04 2021)
12. Kiddon, C., Brun, Y.: That's what she said: double entendre identi cation. In:
Proceedings of the 49th annual meeting of the association for computational
linguistics: Human language technologies. pp. 89{94 (2011)
13. Kim, Y.: Convolutional Neural Networks for Sentence Classi cation pp. 1746{1751
(2014)
14. Kingma, D.P., Ba, J.L.: A : a m s o pp. 1{15 (2015)
15. Mihalcea, R., Strapparava, C.: Making computers laugh: Investigations in
automatic humor recognition. In: Proceedings of Human Language Technology
Conference and Conference on Empirical Methods in Natural Language Processing. pp.
531{538 (2005)
16. Owens, J.D., Houston, M., Luebke, D., Green, S., Stone, J.E., Phillips, J.C.: Gpu
computing. Proceedings of the IEEE 96(5), 879{899 (2008)
17. Potash, P., Romanov, A., Rumshisky, A.: SemEval-2017 task 6: #HashtagWars:
Learning a sense of humor. In: Proceedings of the 11th International Workshop on
Semantic Evaluation (SemEval-2017). pp. 49{57. Association for Computational
Linguistics, Vancouver, Canada (Aug 2017).
https://doi.org/10.18653/v1/S172004, bluehttps://www.aclweb.org/anthology/S17-2004
18. Purandare, A., Litman, D.: Humor: Prosody analysis and automatic recognition for
f* r* i* e* n* d* s. In: Proceedings of the 2006 Conference on Empirical Methods
in Natural Language Processing. pp. 208{215 (2006)
19. Ritchie, G.: Developing the incongruity-resolution theory. Tech. rep. (1999)
20. Taylor, J.M., Mazlack, L.J.: Computationally Recognizing Wordplay in Jokes
Theories of Humor (1991) (2000)
21. Taylor, J.M., Mazlack, L.J.: Computationally recognizing wordplay in jokes. In:
Proceedings of the Annual Meeting of the Cognitive Science Society. vol. 26 (2004)</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Abadi</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Barham</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Davis</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dean</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Devin</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ghemawat</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Irving</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Isard</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , et al.:
          <article-title>Tensor ow: A system for large-scale machine learning</article-title>
          .
          <source>In: 12th fUSENIXg Symposium on Operating Systems Design and Implementation (fOSDIg 16)</source>
          . pp.
          <volume>265</volume>
          {
          <issue>283</issue>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Baziotis</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pelekis</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Doulkeridis</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          : DataStories at SemEval
          <article-title>-2017 task 4: Deep LSTM with attention for message-level and topic-based sentiment analysis</article-title>
          .
          <source>In: Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval2017)</source>
          . pp.
          <volume>747</volume>
          {
          <fpage>754</fpage>
          . Association for Computational Linguistics, Vancouver, Canada (Aug
          <year>2017</year>
          ). https://doi.org/10.18653/v1/
          <fpage>S17</fpage>
          -2126, bluehttps://www.aclweb.org/ anthology/S17-2126
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. van den Beukel, S.,
          <string-name>
            <surname>Aroyo</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>Homonym detection for humor recognition in short text</article-title>
          .
          <source>In: Proceedings of the 9th Workshop on Computational Approaches</source>
          to Subjectivity,
          <article-title>Sentiment and Social Media Analysis</article-title>
          . pp.
          <volume>286</volume>
          {
          <issue>291</issue>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Cardellino</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Spanish Billion Words Corpus and Embeddings (August</article-title>
          <year>2019</year>
          ), bluehttps://crscardellino.github.io/SBWCE/
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Castro</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chiruzzo</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosa</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Overview of the haha task: Humor analysis based on human annotation at ibereval 2018</article-title>
          . In: IberEval@ SEPLN. pp.
          <volume>187</volume>
          {
          <issue>194</issue>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Chen</surname>
          </string-name>
          , P.Y.,
          <string-name>
            <surname>Soo</surname>
            ,
            <given-names>V.W.</given-names>
          </string-name>
          :
          <article-title>Humor Recognition Using Deep Learning pp</article-title>
          .
          <volume>113</volume>
          {
          <issue>117</issue>
          (
          <year>2018</year>
          ). https://doi.org/10.18653/v1/n18-
          <fpage>2018</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Chiruzzo</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Castro</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Etcheverry</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Garat</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Prada</surname>
            ,
            <given-names>J.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosa</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Overview of haha at iberlef 2019: Humor analysis based on human annotation</article-title>
          .
          <source>In: IberLEF@ SEPLN</source>
          . pp.
          <volume>132</volume>
          {
          <issue>144</issue>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Chiruzzo</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Castro</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gongora</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosa</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Meaney</surname>
            ,
            <given-names>J.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mihalcea</surname>
          </string-name>
          , R.: Overview of HAHA at IberLEF 2021:
          <article-title>Detecting, Rating and Analyzing Humor in Spanish</article-title>
          .
          <source>Procesamiento del Lenguaje Natural</source>
          <volume>67</volume>
          (
          <issue>0</issue>
          ) (
          <year>2021</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>De Oliveira</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rodrigo</surname>
            ,
            <given-names>A.L.</given-names>
          </string-name>
          :
          <article-title>Humor detection in yelp reviews</article-title>
          .
          <source>Retrieved on December 15</source>
          ,
          <year>2019</year>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Ghosh</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Veale</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosso</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shutova</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Barnden</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reyes</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          : SemEval-2015 task 11:
          <article-title>Sentiment analysis of gurative language in Twitter</article-title>
          .
          <source>In: Proceedings of the 9th International Workshop on Semantic Evaluation (SemEval</source>
          <year>2015</year>
          ). pp.
          <volume>470</volume>
          {
          <fpage>478</fpage>
          . Association for Computational Linguistics, Denver, Colorado (Jun
          <year>2015</year>
          ). https://doi.org/10.18653/v1/
          <fpage>S15</fpage>
          -2080, bluehttps://www.aclweb.org/ anthology/S15-2080
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>