<!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>CIMAT-NLP at HOMO-MEX2023@IBERLEF: Machine Learning Techniques For Fine-grained Speech Detection Task</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Erika Rivadeneira-Pérez</string-name>
          <email>erika.rivadeneira@cimat.mx</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>María de Jesús García-Santiago</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Cipriano Callejas-Hernández</string-name>
          <email>cipriano.callejas@cimat.mx</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Mathematics Research Center (CIMAT)</institution>
          ,
          <addr-line>Guanajuato</addr-line>
          ,
          <country country="MX">Mexico</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2023</year>
      </pub-date>
      <abstract>
        <p>With the increasing number of social media users, the number of posts containing Hate Speech (HS) has also increased, leading to various issues. Therefore, it is crucial to develop automatic HS detection systems for social media platforms. In this article, we present some Machine Learning techniques used in HS detection on HOMO-MEX competition task. In particular, our focus is on detecting HS targeted towards the Mexican Spanish-speaking LGBT+ population, addressing the Fine-grained detection problem. This task presents an additional complexity due to its nature as a multi-label problem.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Over the past years, interest in online Hate Speech (HS) detection and particularly the
automatization of this task has continuously grown, along with the social impact of the phenomenon
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. This has been prompted by the increasing anxieties about the prevalence of Hate Speech
on social media, and the psychological and societal harms that ofensive messages can cause
[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], for instance, in 2016 there was a genocide of Rohingya community in Myanmar as part
of an anti-Muslim violence movement made in a Facebook post, in the same study, they
reported that posts corresponding to hate speech tends to spread faster than non-hate ones, see
[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Because of cases like the one in Myanmar, and similar ones, social media platforms have
adopted self-imposed definitions, guidelines, and policies for dealing with this particular kind
of ofensive language. In response, automatic detection of hate speech has become a popular
research area in Natural Language Processing (NLP), since what is considered Hate Speech
might be influenced by aspects such as the domain of the utterance, its discourse context, and
others. In a more deep level study, finding specific targeted groups in Hate Speech discourses
is of interest, this is what we referred as fine-grained detection. In this work, we describe our
approaches for the HOMO-MEX Hate Speech detection towards the Mexican Spanish speaking
LGBT+ population competition track 2: Fine-grained hate speech detection (Multi-labeled) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <sec id="sec-1-1">
        <title>1.1. Hate Speech Detection</title>
        <p>
          In this work, as in [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] we consider HS as any communication that targets a person or a group
based on some characteristics such as race, color, sexual orientation, gender identity, and
others. In particular, we are interested in a fine-grained detection, that is, identifying
LGBTspecific phobias in each given tweet. What diferentiates a hateful speech utterance from a
harmless one is probably not attributable to a single class of influencing aspects. While the
set of features examined in diferent works greatly varies the classification methods for this
task are mainly focused on supervised learning, which carries an existing bias we shall discuss
later. However, we consider a ML approach as a starting point in the approaches described below.
        </p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2. Fine-grained hate speech detection track (Multi-labeled).</title>
      <p>
        The various systems developed so far frequently adopt a binary classification framework: given
a social media post, a tweet in our case, the system should classify it either as constituting HS
or not. In the pioneer work of Davidson et al [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] tweets were primarily filtered as either being
ofensive language or not, and all ofensive tweets subsequently classified as constituting HS
or not. Later Qian et al [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] using deep learning techniques distinguish among 40 hate groups,
13 diferent hate group ideologies (white nationalist, anti-immigration, etc). However as we
shall see this fined grained approach depends on there being enough data associated with each
sub-type, see [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <sec id="sec-2-1">
        <title>2.1. Corpus Description</title>
        <p>The dataset is composed 863 of Mexican Spanish tweets extracted from 2012 to 2022. Each tweet
is multi-labeled with a five-entry vector concerning the phobias it contains, either 0 or 1 for
each slot, where the first entry is Lesbophobia (L), Gayphobia (G), Biphobia (B), Transphobia
(T) and other LGBT+ phobia (O). In figure 1 we have an example of a labeled tweet.</p>
        <p>One challenge associated with this dataset lies in the unbalance distribution of observations
across categories. The category pertaining to hate speech towards the Gay population
encompasses a substantial majority, accounting for 76% of the observations. In contrast, the tweets
categorized as ‘L’ constitute only 7.7%, while ‘B’ category comprise only 1% each, see Figure 2.
Consequently, training a classification model with such a dataset leads to an imbalance
favoring the Gay population, as there exists a scarcity of observations in the remaining categories
(‘L’, ‘B’, ‘T’, and ‘O’). Consequently, the models fail to acquire suficient knowledge about the
characteristics associated with these underrepresented populations.</p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. Corpus Preprocessing and Representation Selection</title>
        <p>With the aim of getting homogeneous text data, our preprocessing approach was a follows. See
Figure 3 for an example of a preprocessed tweet.</p>
        <p>The text transformations applied on the original tweets were the following:
• Reducing repeated emojis:</p>
        <p>We consider that the presence of multiple repeated emojis in tweets adds unnecessary
noise during the training of our models. Therefore, we reduce the number of repeated
emojis to just one occurrence.
• Removing special characters and URLs:</p>
        <p>Special characters and URLs in tweets often do not contribute significantly to the
classification task and can introduce noise. Thus, we remove them from the text.
• Mentions substitution:</p>
        <p>We replace all user mentions with the generic term “@user”. This substitution is done to
ensure that the model learns the intent of the tweets as a whole, rather than focusing on
individual users. By generalizing user mentions, we aim to improve the model’s ability to
classify LGBT+phobic tweets globally.
2.3. Approach 1.</p>
        <p>In this section, we present our first approach for the fine-grained classification problem. This
approach is based on the idea of splitting the original problem into several independent binary
classification problems, for each category ‘L’,‘G’,‘B’,‘T’ and ‘O’ (see Figure 4), and then, using a
BOW representation, we classify them with classical machine learning methods.</p>
        <p>The procedure of this first approach is as follows:
• Dataset Splitting:</p>
        <p>Once text data is preprocessed, we divide the training dataset into new subsets, each
corresponding to a specific category (L, G, B, T, O), see Figure 4. This division allows us
to train classifiers individually for each category. The splitting is performed as follows:
– Training set: 90% of the preprocessed data is allocated for training purposes. This
large portion of the data ensures that the classifiers have suficient samples to learn
from.
– Test set: The remaining 10% of the preprocessed data is used as a test set, providing
true labels for evaluation and performance assessment.</p>
        <p>For the feature extraction we considered only surface level ones, this is, n-grams for
word tokens. This results in a simple TF-IDF weighted BOW representation of the data.
Let us remark that this did not change across the five binary classification problems, all
parameters were kept equal.</p>
        <p>
          Then, we proceed to train and evaluate classifiers with TF-IDF matrices corresponding to
each category of LGBT+phobia. The following classifiers are employed:
– Random Forest: This ensemble learning method combines multiple decision trees to
improve the classification accuracy [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ].
– Support Vector Machines (SVM): SVM is a powerful classifier that finds an optimal
hyperplane to separate data points into diferent categories [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ].
– Gaussian processes: Gaussian processes model the probability distribution over
functions and are employed as a probabilistic classifier in our approach [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ].
• Evaluation and Model Selection:
        </p>
        <p>After training the classifiers, we evaluate the model of each class performance using MAE
and F1-score. Based on the evaluation results, we select the best-performing model. See
table 2.3.</p>
        <p>Classifier</p>
        <p>Metric
Random Forest</p>
        <p>SVM
Gaussian Processes</p>
        <p>F1
MAE</p>
        <p>F1
MAE</p>
        <p>F1
MAE</p>
        <p>L
2.4. Approach 2.</p>
        <p>The second approach was again a BOW representation of textual data, but keeping the
multilabel, as we still used the main idea in Approach 1, but with a change, in the sense that all
classifiers were internally modified instead of considering explicitly five independent binary
classification problems.</p>
        <p>The preprocess of tweets was kept as in Approach 1, and a variety of traditional ML techniques
(Support Vector Machine, RidgeClassifier and Logistic Regression) modified with OnevsRest
option were considered with diferent n-grams. Additionally, a dimensional reduction technique
with K best features using the  2 function was used.</p>
        <p>The OverVSRestClassifier is a strategy that consists in create independent binary classifiers
for each label, this means that the classifier fits one specific label versus the second label for
classification which is the joined data from the other classes. Consequently, each one of these
binary classifiers specializes to classify one phobia. The final output is a straightforward vector
of dimension 5 where the one in the entries means the positiveness of the class.
2.4.1. Evaluation and Model Selection
We used diferent models using the given dataset with a partition of 90% train and 10% for test.
Then after trial and error, we choose the best model, see 2.4.1 for some tried trials.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Results</title>
      <p>The evaluation of the task considered macro-average F1 measure with respect to the positive
class for each label with the unweighted mean. We have described our two approaches for Task
1, in Table 3 we can see that our first approach reached the third place in this competition.</p>
      <p>Approaches</p>
      <p>F1-score
I2C-HUELVA</p>
      <p>Carfer
Approach 1
Approach 2
bayesiano98</p>
    </sec>
    <sec id="sec-4">
      <title>4. Bias and Ethical Issues</title>
      <p>
        Algorithms are executed automatically and with no human intervention or oversight, opaquely
shaping discourse on the internet. It is known that these are useful not only for finding
information, but also for providing people with tools to organize and classify knowledge, as
well as to take part in social or political discourse. To this point, we emphasize in the intrinsic
bias that can be found in this type of datasets, this has consequences, for instance, the content
produced by justice organizations is censored or tagged as HS [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], this could lead to the
censorship of LBGTQ+ people’s attempts to reclaim these words as means for self-expression.
On the other hand, the task of classifying millions of ofensive tweets is usually crowd sourced,
yet it is hard to guarantee quality control using that method. The subjectivity of annotators
remains problematic, and it arises from diverging perceptions of what constitutes HS.[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Let us
remark in this section that two ethical extremes are usually considered during HS detection,
either entirely permitting or entirely prohibiting the posting of certain messages, regard as free
of speech. Recently new approaches have been proposed, such is the case of quarantining HS
[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], situated in between this extremes, where the senders of HS are not censored in a crude
unilateral matter, but the recipients of HS are given the option to determine how they wish to
handle the HS they have received.
      </p>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusions</title>
      <p>Both of our approaches follow the same core, to divide the multi-classification problem into
single ones, let us remark here that as seen in Table 3 manually considering independent
problems proved to be more eficient that using the internal option of OneVSRest in such classifiers.
We hypothesize that this is because we are slightly free to choose either the parameters or
classifiers to be used in each binary problem.</p>
      <p>
        In general, our work followed a traditional approach using BOW representation of text data
with a Machine Learning classifiers, we believe that the result might be improved if additional
features are taken into consideration as proposed in the survey [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The ML approach usually
yields a good classification performance in binary tasks [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], hence our general approach of
splitting. On the other hand, one could suggest the use of pre-trained models such as
transformers, but they are known to have limited efectiveness [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. Finally, in popular opinion,
data augmentation can also be considered as well, however in our case we decided not to
follow this approach since this can carry the intrinsic bias the train set already presents, see Figure 2.
      </p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>The authors thank Fernando Sánchez-Vega from Centro de Investigación en Matemáticas (CIMAT)
and Consejo Nacional de Ciencia y Tecnología (CONACYT) and its support through the Program
“Investigadoras e Investigadores por México” by the project “Desarrollo de Inteligencia Artificial
aplicada a la prevención de violencia y salud mental.” (ID. 11989, No. 1311) for which the second
author is part of.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>P.</given-names>
            <surname>Fortuna</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Domínguez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Wanner</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Talat</surname>
          </string-name>
          ,
          <article-title>Directions for nlp practices applied to online hate speech detection</article-title>
          ,
          <source>in: Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing</source>
          ,
          <year>2022</year>
          , pp.
          <fpage>11794</fpage>
          -
          <lpage>11805</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>E.</given-names>
            <surname>Heinze</surname>
          </string-name>
          ,
          <article-title>Hate speech and democratic citizenship</article-title>
          , Oxford University Press,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>B.</given-names>
            <surname>Mathew</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Dutt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Goyal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Mukherjee</surname>
          </string-name>
          ,
          <article-title>Spread of hate speech in online social media</article-title>
          ,
          <source>in: Proceedings of the 10th ACM Conference on Web Science</source>
          , WebSci '19,
          <string-name>
            <surname>Association</surname>
          </string-name>
          for Computing Machinery, New York, NY, USA,
          <year>2019</year>
          , p.
          <fpage>173</fpage>
          -
          <lpage>182</lpage>
          . URL: https://doi.org/10. 1145/3292522.3326034. doi:
          <volume>10</volume>
          .1145/3292522.3326034.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>G.</given-names>
            <surname>Bel-Enguix</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Gómez-Adorno</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Sierra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Vásquez</surname>
          </string-name>
          , S.-T. Andersen,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ojeda-Trueba</surname>
          </string-name>
          ,
          <article-title>Overview of HOMO-MEX at Iberlef 2023: Hate speech detection in Online Messages directed tOwards the MEXican spanish speaking LGBTQ+ population</article-title>
          ,
          <source>Procesamiento del lenguaje natural 71</source>
          (
          <year>2023</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>T.</given-names>
            <surname>Davidson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Warmsley</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Macy</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Weber</surname>
          </string-name>
          ,
          <article-title>Automated hate speech detection and the problem of ofensive language</article-title>
          ,
          <source>in: Proceedings of the international AAAI conference on web and social media</source>
          , volume
          <volume>11</volume>
          ,
          <year>2017</year>
          , pp.
          <fpage>512</fpage>
          -
          <lpage>515</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J.</given-names>
            <surname>Qian</surname>
          </string-name>
          ,
          <string-name>
            <surname>M. ElSherief</surname>
            , E. Belding,
            <given-names>W. Y.</given-names>
          </string-name>
          <string-name>
            <surname>Wang</surname>
          </string-name>
          ,
          <article-title>Hierarchical cvae for fine-grained hate speech classification</article-title>
          , arXiv preprint arXiv:
          <year>1809</year>
          .
          <volume>00088</volume>
          (
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>S.</given-names>
            <surname>Ullmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Tomalin</surname>
          </string-name>
          ,
          <article-title>Quarantining online hate speech: technical and ethical perspectives</article-title>
          ,
          <source>Ethics and Information Technology</source>
          <volume>22</volume>
          (
          <year>2020</year>
          )
          <fpage>69</fpage>
          -
          <lpage>80</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>A.</given-names>
            <surname>Cutler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. R.</given-names>
            <surname>Cutler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. R.</given-names>
            <surname>Stevens</surname>
          </string-name>
          , Random forests,
          <source>Ensemble machine learning: Methods and applications (</source>
          <year>2012</year>
          )
          <fpage>157</fpage>
          -
          <lpage>175</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>W. S.</given-names>
            <surname>Noble</surname>
          </string-name>
          ,
          <article-title>What is a support vector machine?</article-title>
          ,
          <source>Nature biotechnology 24</source>
          (
          <year>2006</year>
          )
          <fpage>1565</fpage>
          -
          <lpage>1567</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>C. K. Williams</surname>
            ,
            <given-names>C. E.</given-names>
          </string-name>
          <string-name>
            <surname>Rasmussen</surname>
          </string-name>
          ,
          <article-title>Gaussian processes for machine learning</article-title>
          , volume
          <volume>2</volume>
          , MIT press Cambridge, MA,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>D. O.</given-names>
            <surname>Thiago</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. D.</given-names>
            <surname>Marcelo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Gomes</surname>
          </string-name>
          ,
          <article-title>Fighting hate speech, silencing drag queens? artificial intelligence in content moderation and risks to lgbtq voices online</article-title>
          ,
          <source>Sexuality &amp; culture 25</source>
          (
          <year>2021</year>
          )
          <fpage>700</fpage>
          -
          <lpage>732</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>A.</given-names>
            <surname>Schmidt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Wiegand</surname>
          </string-name>
          ,
          <article-title>A survey on hate speech detection using natural language processing</article-title>
          ,
          <source>in: Proceedings of the Fifth International Workshop on Natural Language Processing for Social Media</source>
          , Association for Computational Linguistics, Valencia, Spain,
          <year>2017</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>10</lpage>
          . URL: https://aclanthology.org/W17-1101. doi:
          <volume>10</volume>
          .18653/v1/
          <fpage>W17</fpage>
          - 1101.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>