<!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>A Contextualized Word Representation Approach for Irony Detection</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Lizeth Garc a</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Daniela Moctezuma</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>V ctor Mun~iz</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Centro de Investigacion en Ciencias de Informacion Geoespacial A.C.</institution>
          ,
          <addr-line>Aguascalientes</addr-line>
          ,
          <country country="MX">Mexico</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Centro de Investigacion en Matematicas A.C.</institution>
          ,
          <addr-line>Monterrey, NL.</addr-line>
          <country country="MX">Mexico</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2019</year>
      </pub-date>
      <fpage>285</fpage>
      <lpage>290</lpage>
      <abstract>
        <p>IroSvA (Irony Detection in Spanish variants) is a contest dedicated to identify the presence of irony in a given context in short messages written in Spanish, speci cally tweets and news comments. In this case, it is necessary to consider that irony may be expressed in a di erent way according to the Spanish variant, which makes this task more complex to tackle it. Taking into account that irony detection is a very important task in many applications, we proposed a system based on a distributed representation of the texts, using the ELMo approach. We did not use any handcrafted features, lexicons or external datasets as prior information.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Irony is a sophisticated way of communication, characterized by the speaker
saying something di erent, generally the opposite, than what he or she means to.
In the case of texts, this becomes more complicated due to lack of gestures such
as facial expressions or variations in the voice or tones. The automatic detection
of irony has been widely studied, mainly in English, although there are a variety
of works for other languages. Di erent approaches have been proposed to identify
irony in texts. In general terms, we can identify those models based on bag of
features (lexical and/or semantic) and those based on Neural Network Language
Models, which includes Deep Leaning and Recurrent Neural Networks, among
many others architectures.</p>
      <p>
        The initial approaches proposed to detect irony were mainly based on rules
or lexical features. Most of the attempts were made using classi cation models
which relied on textual cues such as lexical indicators like punctuation symbols,
interjections, quotation marks [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], emotional scenarios and style features as
textual sequences, such as character n-grams, skip-grams, and polarity s-grams [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ],
among others. However, these methods cannot utilize contextual information
from texts. Due to this, models based on semantic features have been developed
to tackle the task of irony detection. In [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], semantic information has been
incorporated into the feature representation like synonyms and rare words, while
[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] uses word embeddings to capture context incongruity through the semantic
similarity/discordance.
      </p>
      <p>
        In recent years, the use of deep learning architectures for tracking irony in
Twitter showed a signi cant improvement over traditional methods. A few
representative works in this direction are based on LSTM architecture. In [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], the
authors designs and ensembles two independent models, based on BiLSTM, which
operate at the word and character level, in order to capture both the semantic
and syntactic information in tweets. The proposal in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] adopted the Siamese
architecture to detect incongruity between di erent sections of a sentence, usual
in the irony.
      </p>
      <p>
        In this paper, we describe our system submitted to IroSvA shared task
dedicated to identifying the presence of irony in short messages [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. We propose a
word-level representation in order to exploit the semantic information of each
text, by using Contextualized Word Vectors. Speci cally, we use the Deep
Contextualized Word Representations ELMo (Embeddings from Language Models)
from [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], which use bidirectional language model (biLM) to learn both word
(e.g., syntax and semantics) and linguistic context (i.e., to model polysemy).
For this purpose, we employ pre-trained ELMo vectors to predict whether a
tweet is ironic or not for each Spanish variant.
      </p>
      <p>
        It is worthwhile to say that, in order to tackle this contest, we explore di erent
models based on di erent features extracted from texts, i.e., lexical, semantic and
combination of both. Lexical features were similar to those described before,
and for the semantic ones, we explored architectures for word and document
embeddings based on the proposals of [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] and [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. After an extensive set of
experiments, and using di erent classi cation methods, we choose the model
with the best results, and is the one we report in this paper.
      </p>
      <p>In the followings sections, all the details of data and the system proposed are
explained.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Dataset preparation and resources</title>
      <p>The dataset used in this work is provided by the contest organizers. This corpus
consist of 9; 000 tweets about di erent topics, 3; 000 for each Spanish variant from
Cuba, Mexico, and Spain. Approximately, 80% of the corpus is used for training
purposes, while the remaining 20% is used for test. The detailed statistics of the
train data in each subtask are shown in Table 1. In this Table it can be see the
number of topics in each Spanish variant, as well as the number of samples with
and without irony.
Variant Topics No Irony Irony
Mexico 10 1600 800
Spain 10 1600 800
Cuba 9 1600 800
Preprocessing steps are essential to any text classi cation task. In this work
we apply several standard preprocessing techniques. That is, for each tweet, we
made several processes in the following order:
{ Tokenization. We use a word representation in order to exploit semantic and
linguistic information of each word in order to predict irony in text.
{ In the case of Mexico and Spain variants, @user from the tweets are replaced
with a unique special tag.
{ We omitted URLs, emails and numbers.
{ Hashtags are processed removing the special symbol # and keeping the text.
{ Stop words are not removed.</p>
      <p>{ As nal step, we convert all characters to lowercase.
2.2</p>
      <p>
        Word Embeddings
We use the ELMo pre-trained word embeddings provided by [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], which were
trained with a corpus of 20 million-words randomly sampled from the raw text
released by the CoNLL 2018 shared task (wikidump + common crawl) for
Spanish language. One of the main characteristics of ELMo (di erent from other
word embeddings approaches), is that we can obtain multiple embeddings for
each word depending on the context it was used. Higher-level layers capture
context-dependent aspects of word embeddings while lower-level layers capture
model aspects of syntax. In our case, we only use the top layer (layer number
0) for each word, and then we use the average as a function to group the words
within a sentence.
      </p>
      <p>
        For training purposes, the train dataset was split into 5 folds for each
subtask. Our experimentation is performed using several classi ers: Support
Vector Machines, Random Forests, and Logistic Regression, for which we used the
scikit-learn implementation [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. As we consider a semantic approach, we
implemented a Baseline based on a distributed representation using doc2vec to obtain
the embeddings for each tweet, and Random Forests as the classi er.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Experiments and Results</title>
      <p>For evaluation purposes, we use the macro F1 average metric to select the
classi er among the options mentioned before and compare the performance of our
model against this baseline. Table 2 shows the results for the 5-Fold Cross
Validation approach for each classi er, the best performance in each subtask is
obtained with Logistic Regression. In comparison with the baseline, there is a
slight improvement when we use of ELMo vectors for the variants of Cuba and
Mexico, however, in the case of Spain, the performance of the ELMO model does
not exceed the baseline. It is important to note that Random Forest has a good
performance when we use the embeddings obtained with doc2vec but not with
the embeddings obtained with ELMO.</p>
      <p>For each sub tasks, our model is compared with the o cial baseline. The
best result we obtained, as it is shown in Table 3, is 0:6396 for the Cuba dataset.
In the case of Mexico, the W2V and Word nGrams models perform similarly
to our model with respect to F1 metric. The worst result we attained is in the
Spain dataset. The results obtained in the test dataset are consistent with those
obtained in the experiments.
Detection of irony has been widely studied in recent years. However, works
focused on the detection of irony for Spanish texts are still scarce, and there are
no references to the complexity of this task for Spanish. It is necessary to take
into account that IroSvA task also seeks to study the way irony changes in
different variants of the language. We developed a system based on contextualized
word representation, which seeks to establish the relationship of a word within
its context, and thus, to identify irony.</p>
      <p>Our proposal achieved an average F1 score of 0.6256, which is below the
semantic baseline of W2V. For the Cuban texts, we obtained an F1 score superior
to all the baseline, which we believe is due to the di erence between the source
of information of the Cuban texts compared to those of Mexico and Spain. The
texts extracted from Twitter (the case of Mexico and Spain) usually have more
noise than those texts that come from news comment due to the reduction of
words by the limit of characters per tweet and by the use of resources such as
images, emojis and references to another tweets to complement the context of
the message.</p>
      <p>Our model had a lower performance in texts that come from Twitter, which
we believe is due to the fact that the semantic representations we used, based on
words, does not represent the way people write on social networks, where errors,
misspellings, abbreviations or repetition of letters to emphasize a word are very
common.</p>
      <p>As future work, we want to prepare and use a corpus based on Twitter
texts in Spanish in order to train word embedding methods. We believe that the
performance reported in this paper can be improved by using the embedding
trained in this way. Also, we plan to explore character-level embedding models
that can be tested in combination with lexical features for further improvement
of the results.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Barbieri</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ronzano</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Saggion</surname>
          </string-name>
          , H.:
          <article-title>Italian irony detection in twitter: a rst approach</article-title>
          .
          <source>In: The First Italian Conference on Computational Linguistics</source>
          CLiC-it. p.
          <volume>28</volume>
          (
          <year>2014</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>Athanasiou</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Papalampidi</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kolovou</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paraskevopoulos</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ellinas</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Potamianos</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Ntua-slp at semeval-2018 task 3: Tracking ironic tweets using ensembles of word and character level attentive rnns</article-title>
          . arXiv preprint arXiv:
          <year>1804</year>
          .
          <volume>06659</volume>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Carvalho</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sarmento</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Silva</surname>
            ,
            <given-names>M.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Oliveira</surname>
          </string-name>
          , E.:
          <article-title>Clues for detecting irony in user-generated contents: oh</article-title>
          ...!
          <article-title>! it's so easy;-</article-title>
          .
          <source>In: Proceedings of the 1st international CIKM workshop on Topic-sentiment analysis for mass opinion</source>
          . pp.
          <volume>53</volume>
          {
          <fpage>56</fpage>
          .
          <string-name>
            <surname>ACM</surname>
          </string-name>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Che</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          , Liu,
          <string-name>
            <given-names>Y.</given-names>
            ,
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            ,
            <surname>Zheng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            ,
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <surname>T.</surname>
          </string-name>
          :
          <article-title>Towards better UD parsing: Deep contextualized word embeddings, ensemble, and treebank concatenation</article-title>
          .
          <source>In: Proceedings of the CoNLL</source>
          <year>2018</year>
          <article-title>Shared Task: Multilingual Parsing from Raw Text to Universal Dependencies</article-title>
          . pp.
          <volume>55</volume>
          {
          <fpage>64</fpage>
          . Association for Computational Linguistics, Brussels, Belgium (
          <year>October 2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Ghosh</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Veale</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Ironymagnet at semeval-2018 task 3: A siamese network for irony detection in social media</article-title>
          .
          <source>In: Proceedings of The 12th International Workshop on Semantic Evaluation</source>
          . pp.
          <volume>570</volume>
          {
          <issue>575</issue>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Joshi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tripathi</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patel</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bhattacharyya</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Carman</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Are word embedding-based features useful for sarcasm detection</article-title>
          ?
          <source>arXiv preprint arXiv:1610.00883</source>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Le</surname>
            ,
            <given-names>Q.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mikolov</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Distributed representations of sentences and documents</article-title>
          .
          <source>In: International conference on machine learning</source>
          . pp.
          <volume>1188</volume>
          {
          <issue>1196</issue>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Mikolov</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Corrado</surname>
            ,
            <given-names>G.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dean</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>E cient estimation of word representations in vector space (</article-title>
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Ortega-Bueno</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rangel</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          , Hernandez Far as,
          <string-name>
            <given-names>D.I.</given-names>
            ,
            <surname>Rosso</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Montes-</surname>
          </string-name>
          y-Gomez,
          <string-name>
            <surname>M.</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Medina</given-names>
            <surname>Pagola</surname>
          </string-name>
          ,
          <string-name>
            <surname>J.E.</surname>
          </string-name>
          :
          <article-title>Overview of the Task on Irony Detection in Spanish Variants</article-title>
          .
          <source>In: Proceedings of the Iberian Languages Evaluation Forum (IberLEF</source>
          <year>2019</year>
          ),
          <article-title>co-located with 34th Conference of the Spanish Society for Natural Language Processing (SEPLN</article-title>
          <year>2019</year>
          ).
          <article-title>CEUR-WS.org (</article-title>
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Pedregosa</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Varoquaux</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gramfort</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Michel</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Thirion</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grisel</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Blondel</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Prettenhofer</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weiss</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dubourg</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vanderplas</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Passos</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cournapeau</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Brucher</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Perrot</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Duchesnay</surname>
          </string-name>
          , E.:
          <article-title>Scikit-learn: Machine learning in Python</article-title>
          .
          <source>Journal of Machine Learning Research</source>
          <volume>12</volume>
          ,
          <volume>2825</volume>
          {
          <fpage>2830</fpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Peters</surname>
            ,
            <given-names>M.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Neumann</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Iyyer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gardner</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Clark</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zettlemoyer</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>Deep contextualized word representations</article-title>
          .
          <source>arXiv preprint arXiv:1802</source>
          .
          <volume>05365</volume>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Reyes</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosso</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Veale</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>A multidimensional approach for detecting irony in twitter</article-title>
          .
          <source>Language resources and evaluation 47(1)</source>
          ,
          <volume>239</volume>
          {
          <fpage>268</fpage>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>