<!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>I2C-Huelva at HOPE2023@IberLEF: Simple Use of Transformers for Automatic Hope Speech Detection</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Juan Luis Domínguez Olmedo</string-name>
          <email>juan.dominguez@dti.uhu.es</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jacinto Mata Vázquez</string-name>
          <email>mata@uhu.es</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Victoria Pachón Álvarez</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>I2C Research Group, University of Huelva</institution>
          ,
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We present in this paper our participation in the share task Multilingual Hope Speech detection (HOPE) at IberLEF-2023. It consists of two binary subtasks with notable differences in terms of language and balance of labels. For the first task we have used BERTuit, a transformer model proposed for Spanish language; and for the second one we employed DistilBERT, a light transformer model trained by distilling BERT base. After several submissions for these tasks, we achieved an average macro F1 value of 0.744 in the first task, at the second position of the leaderboard; in the second task we finally ranked at first position, with an average macro F1 value of 0.501.</p>
      </abstract>
      <kwd-group>
        <kwd>1 Hope speech detection</kwd>
        <kwd>Transformers</kwd>
        <kwd>BERTuit</kwd>
        <kwd>DistilBERT</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Hope Speech (HS) is the type of speech that can relax a hostile environment [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and that helps, gives
suggestions, and inspires for good to several people when they are in times of illness, stress, loneliness
or depression [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        By detecting it automatically, positive comments can be more widely disseminated, and can have a
very significant effect when it comes to combating sexual or racial discrimination or when we seek to
foster less bellicose environments [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>
        Offensive messages on social media are posted towards people because of their race, color, ethnicity,
gender, sexual orientation, nationality, or religion. As [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] stated, the importance of the social media
lives of vulnerable groups, such as people belonging to the Lesbian, Gay, Bisexual, and Transgender
(LGBT) community, racial minorities or people with disabilities, has been studied and it has been found
that the social media activities of a vulnerable individual play an essential role in shaping the
individual’s personality and how he or she views society [
        <xref ref-type="bibr" rid="ref3 ref4 ref5">3, 4, 5</xref>
        ].
      </p>
      <p>
        The shared task “HOPE. Multilingual Hope Speech detection” is part of IberLEF-2023, an
evaluation campaign for Natural Language Processing (NLP) systems where several challenges are run
with large international participation from research groups in academia and industry [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. This task is
related to the inclusion of vulnerable groups and focuses on the study of the detection of hope speech,
in pursuit of equality, diversity and inclusion. It consists of, given a text, written in Spanish or English,
identifying whether it contains hope speech or not [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ][
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>After our participation in this task, we present a summary of the work and the results obtained. The
next section shows a description of the subtasks and datasets provided by the organizers. The
experimental methodology and evaluation results are laid out in Sections 3 and 4. And some conclusions
are presented in the last section.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Description of the Subtasks and Datasets</title>
      <p>Next, we will briefly describe the subtasks and datasets provided for the task “HOPE. Multilingual
Hope Speech detection”, part of IberLEF-2023.
2.1.</p>
    </sec>
    <sec id="sec-3">
      <title>Subtask 1: Hope Speech detection in Spanish</title>
      <p>This subtask consists of, given a Spanish tweet, identifying whether it contains hope speech or not.
The possible categories for each text are:
• HS: Hope Speech.</p>
      <p>• NHS: Non-Hope Speech.</p>
      <p>The data provided for this subtask consists of a set of LGBT-related tweets annotated as HS (Hope
Speech) or NHS (Non-Hope Speech) [9].</p>
      <p>A tweet is considered as HS if the text: i) explicitly supports the social integration of minorities; ii)
is a positive inspiration for the LGTBI community; iii) explicitly encourages LGTBI people who might
find themselves in a situation; or iv) unconditionally promotes tolerance. On the contrary, a tweet is
marked as NHS if the text: i) expresses negative sentiment towards the LGTBI community; ii) explicitly
seeks violence; or iii) uses gender-based insults.</p>
      <p>The number of samples and distribution for each category in the training dataset provided by the
organization is shown in Table 1. As it can be seen, the categories were almost equally distributed.
2.2.</p>
    </sec>
    <sec id="sec-4">
      <title>Subtask 2: Hope Speech detection in English</title>
      <p>This subtask consists of, given an English Youtube comment, identifying whether it contains hope
speech or not. The possible categories for each text are:
• HS: Hope Speech.</p>
      <p>• NHS: Non-Hope Speech.</p>
      <p>The English corpus provided for this subtask is an extension of the English part of the HopeEDI
dataset [10]. It consists of comments posted on YouTube videos on a wide range of socially relevant
topics such as Equality, Diversity, and Inclusion, including LGBTIQ issues, COVID-19, women in
STEM, Black Lives Matter, etc.</p>
      <p>The number of samples and distribution for each category in the training dataset provided by the
organization is shown in Table 2. As it can be seen, there exist a clear unbalance in the dataset.</p>
      <p>Category
NHS (Non-Hope Speech)</p>
      <p>HS (Hope Speech)</p>
    </sec>
    <sec id="sec-5">
      <title>Evaluation measures</title>
      <p>To evaluate the results at both subtasks, precision, recall, and F1-score were measured per category
and averaged using the macro-average method. Models were ranked using the macro-F1 score.</p>
    </sec>
    <sec id="sec-6">
      <title>3. Methodology</title>
      <p>A Transformer is a deep learning model that adopts the self-attention mechanism, differentially
weighting the importance of each part of the input data. It is frequently used in the fields of NLP and
Computer Vision [11].</p>
      <p>Simple Transformers is an NLP library designed to simplify the usage of transformer models without
having to compromise on utility. It is built on the work of Hugging Face and their Transformers library
[12, 13].</p>
      <p>At the highest level, Simple Transformers is branched into common NLP tasks such as text
classification, question answering, and language modeling. Each of these tasks have their own
taskspecific Simple Transformers model. It has built-in support for:
• Text Classification
• Token Classification
• Question Answering
• Language Modeling
• Language Generation
• Multi-Modal Classification
• Conversational AI
• Text Representation Generation</p>
      <p>While all the task-specific models maintain a consistent usage pattern (initialize, train, evaluate,
predict), this separation allows the freedom to adapt the models to their specific use case. Figure 1
shows the initial code for an example of a classification model.
3.1.</p>
    </sec>
    <sec id="sec-7">
      <title>Subtask 1</title>
      <p>For the “Hope Speech detection in Spanish” we have employed BERTuit, a transformer proposed
for Spanish language, and pre-trained using RoBERTa optimization [14]. The transformer had been
trained from scratch with text created by native speakers from Twitter, by using more than 230 million
Tweets from the Archive Twitter Stream Grab [15], from 2021 to 2018.</p>
      <p>The training dataset provided by the organizers consisted of 1612 records, of which 821 (51%) were
of the NHS (Non-Hope Speech) category.</p>
      <p>A basic pre-processing was applied to the text, consisting of:
• change text to lowercase
• remove http/https links
• remove the hash sign (#)
• strip whitespace (including newlines)
Apart from that, all the digits were eliminated from the text in some versions of the BERTuit model.</p>
      <p>We have mainly used the default hyperparameters, some of which are shown in the Table 3.</p>
      <p>Apart from that, some extra preprocessing was applied in some versions of the DistilBERT model.
The additional preprocessing consisted in removing Unicode characters, and also removing single
letters and numbers surrounded by space.</p>
      <p>We have mainly used the default hyperparameters, some of which are shown in the Table 4.</p>
    </sec>
    <sec id="sec-8">
      <title>Subtask 1</title>
      <p>Several versions of the BERTuit model were trained and tested using the test dataset provided by
the organizers. The configuration options of the best ones are shown in Table 5.</p>
      <p>Several versions of the DistilBERT model were trained and tested using the test dataset provided by
the organizers. The configuration options of the best ones are shown in Table 7.</p>
      <p>The corresponding evaluation metrics for these models are shown in Table 8. As it can be seen, the
late submission improved the macro F1, due to the increase in both the precision and recall of the HS
category; so it can be deduced that the extra preprocessing worked well in this case.</p>
    </sec>
    <sec id="sec-9">
      <title>5. Conclusions and Further Work</title>
      <p>In this paper we present the methods and results for the shared task Multilingual Hope Speech
detection (HOPE) at IberLEF-2023. We employed BERTuit and DistilBERT transformer models for
the two binary subtasks, respectively. We have used the Simple Transformers library for the python
language.</p>
      <p>After some preprocessing and light tuning of hyperparameters, we achieved acceptable results in
both subtasks after several submissions for testing. We ranked at the second position of the leaderboard
in the Spanish language subtask, and at first position for the English language.</p>
      <p>As future work that could improve the classification results, oversampling/undersampling
techniques could be applied for Subtask 2, which presents a clear unbalance in the distribution of
categories. Also, it might be worth further tuning of the hyperparameters.</p>
    </sec>
    <sec id="sec-10">
      <title>Acknowledgements</title>
      <p>This paper is part of the I+D+i Project titled “Conspiracy Theories and hate speech online:
Comparison of patterns in narratives and social networks about COVID-19, immigrants, refugees and
LGBTI people [NON-CONSPIRA-HATE!]”, PID2021-123983OB-I00, funded by
MCIN/AEI/10.13039/501100011033/ and by “ERDF A way of making Europe”.</p>
      <p>We want to thank Juan M. Calvo Flores for his suggestion on the use of the Simple Transformers
library.
[9] García-Baena, D., García-Cumbreras, M. Á., Jiménez-Zafra, S. M., García-Díaz, J. A., &amp;
Valencia-García, R. (2023). Hope speech detection in Spanish: The LGBT case. Language
Resources and Evaluation, 1-28.
[10] Chakravarthi, B. R., Muralidaran, V., Priyadharshini, R., Cn, S., McCrae, J. P.,
GarcíaCumbreras, M. Á., Jiménez-Zafra, S. M., Valencia-García, R., Kumar Kumaresan, P.,
Ponnusamy, R., García-Baena, D. &amp; García-Díaz, J. (2022). Overview of the Shared Task on
Hope Speech Detection for Equality, Diversity, and Inclusion. In Proceedings of the Second
Workshop on Language Technology for Equality, Diversity and Inclusion (pp. 378-388).
https://aclanthology.org/2022.ltedi-1.58.
[11] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, I.</p>
      <p>Polosukhin, Attention is all you need, in: Proceedings of the 31st Conference on Neural
Information Processing Systems (NIPS 2017), Long Beach, CA, USA, 2017, pp. 5998-6008.</p>
      <p>URL: http://arxiv.org/abs/1706.03762.
[12] Simple Transformers. URL: https://simpletransformers.ai.
[13] Hugging Face. URL: https://huggingface.co.
[14] J. Huertas-Tato, A. Martin, D. Camacho, BERTuit: Understanding Spanish language in</p>
      <p>Twitter through a native transformer, 2022. URL: https://arxiv.org/abs/2204.03465.
[15] Twitter Stream Grab. URL: https://archive.org/details/twitterstream.
[16] DistilBERT. URL: https://huggingface.co/docs/transformers/model_doc/distilbert.
[17] V. Sanh, L. Debut, J. Chaumond, T. Wolf. DistilBERT, a distilled version of BERT: smaller,
faster, cheaper and lighter, 2019. URL: https://arxiv.org/abs/1910.01108.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>S.</given-names>
            <surname>Palakodety</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. R.</given-names>
            <surname>KhudaBukhsh</surname>
          </string-name>
          , J. G. Carbonell,
          <article-title>Hope speech detection: A computational analysis of the voice of peace</article-title>
          ,
          <source>in: Proceedings of the 24th European Conference on Artificial Intelligence, ECAI</source>
          <year>2020</year>
          , IOS Press,
          <year>2020</year>
          , pp.
          <fpage>226</fpage>
          -
          <lpage>236</lpage>
          , doi:10.3233/FAIA200305.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>B. R.</given-names>
            <surname>Chakravarthi</surname>
          </string-name>
          ,
          <article-title>HopeEDI: A multilingual hope speech detection dataset for equality, diversity, and inclusion</article-title>
          ,
          <source>in: Proceedings of the Third Workshop on Computational Modeling of People's Opinions</source>
          , Personality, and
          <article-title>Emotion's in Social Media</article-title>
          ,
          <source>Association for Computational Linguistics</source>
          ,
          <year>2020</year>
          , pp.
          <fpage>41</fpage>
          -
          <lpage>53</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>P.</given-names>
            <surname>Burnap</surname>
          </string-name>
          , G. Colombo,
          <string-name>
            <given-names>R.</given-names>
            <surname>Amery</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hodorog</surname>
          </string-name>
          ,
          <string-name>
            <surname>J.</surname>
          </string-name>
          <article-title>Scourfield, Multi-class machine classification of suicide-related communication on twitter</article-title>
          ,
          <source>Online social networks and media 2</source>
          (
          <year>2017</year>
          )
          <fpage>32</fpage>
          -
          <lpage>44</lpage>
          . doi:
          <volume>10</volume>
          .1016/j.osnem.
          <year>2017</year>
          .
          <volume>08</volume>
          .001.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>V.</given-names>
            <surname>Kitzie</surname>
          </string-name>
          ,
          <article-title>I pretended to be a boy on the internet: Navigating affordances and constraints of social networking sites and search engines for lgbtq+ identity work</article-title>
          ,
          <source>First Monday</source>
          <volume>23</volume>
          (
          <year>2018</year>
          ). doi:
          <volume>10</volume>
          .5210/fm.v23i7.
          <fpage>9264</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>D.N.</given-names>
            <surname>Milne</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Pink</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Hachey</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.A.</given-names>
            <surname>Calvo</surname>
          </string-name>
          , in
          <source>: Proceedings of the third workshop on computational linguistics and clinical psychology</source>
          ,
          <year>2016</year>
          , pp.
          <fpage>118</fpage>
          -
          <lpage>127</lpage>
          . doi:
          <volume>10</volume>
          .18653/v1/
          <fpage>W16</fpage>
          - 0312.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Jiménez-Zafra</surname>
            ,
            <given-names>S. M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rangel</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Montes-</surname>
            y-Gómez,
            <given-names>M.</given-names>
          </string-name>
          (
          <year>2023</year>
          ).
          <article-title>Overview of IberLEF 2023: Natural Language Processing Challenges for Spanish and other Iberian Languages, Proceedings of the Iberian Languages Evaluation Forum (IberLEF 2023), co-located with the 39th Conference of the Spanish Society for Natural Language Processing (SEPLN 2023), CEUR-WS.org</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>IberLEF</given-names>
            <surname>2023 Task - HOPE. Multilingual</surname>
          </string-name>
          Hope Speech detection,
          <year>2023</year>
          . URL: https://codalab.lisn.upsaclay.fr/competitions/10215.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Jiménez-Zafra</surname>
            ,
            <given-names>S. M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>García-Cumbreras</surname>
            ,
            <given-names>M. Á.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>García-Baena</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>García-Díaz</surname>
            ,
            <given-names>J. A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chakravarthi</surname>
            ,
            <given-names>B. R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Valencia-García</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ureña-López</surname>
            ,
            <given-names>L. A.</given-names>
          </string-name>
          (
          <year>2023</year>
          ).
          <article-title>Overview of HOPE at IberLEF 2023: Multilingual Hope Speech Detection</article-title>
          .
          <source>Procesamiento del Lenguaje Natural</source>
          , vol
          <volume>71</volume>
          , septiembre
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>