<!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>Profiling Hate Speech Spreaders on Twitter</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Àngel Andújar Carracedo</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Raquel Jiménez Mondéjar</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Universitat Politècnica de València</institution>
          ,
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2021</year>
      </pub-date>
      <abstract>
        <p>In this paper we summarize our participation in the CLEF conference 2021 regarding the Profiling Hate Speech Spreaders on Twitter task. We suggested a Support Vector Machine classifier that uses as features word n-grams. Our final software achieved an accuracy of 72% in English, 82% in Spanish and therefore, an average accuracy of 77%. The evolution that social media have experienced, becoming an essential factor in the communication of today's society [1], has led to new data sources. That is why a lot of organizations use this data as a tool to analyze the feedback about some of their events, members, or products. However, organizations need to be able to discern between which opinions are written by users whose based solely on hating, and which are not to be able to do an objective analysis. The goal of Profiling Hate Speech Spreaders on Twitter task is to identify possible hate speech spreaders as a first step towards preventing hate speech from being propagated among online users. Thus, in order to distinguish between authors, we use character and word n-grams as a feature with a Support Vector Machine (SVM) classifier and we prove different preprocessing strategies to provide a prediction for each user. In Section 2 we expose various related works on this task. In section 3 we present our method and different models and preprocessing strategies that we have tested. In Section 4 we show our results and finally, in Section 5, we expose the conclusions we have reached.</p>
      </abstract>
      <kwd-group>
        <kwd>1 Hate speech</kwd>
        <kwd>n-gram</kwd>
        <kwd>Support Vector Machine</kwd>
        <kwd>Twitter</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>2. Related Works</title>
      <p>Most social networks have imposed rules on users that prohibit hate speech. However, controlling
that these standards are met requires a large amount of manual work to review user reports. Due to this
fact many of these platforms have increased the number of people in charge of controlling the generated
content. Therefore, developing systems that are capable of detecting hateful users streamlines the
review process by helping moderators to dismiss false reports. In order to develop automated hate
speech detection systems, it should be noted that there are different approaches to this task.</p>
      <p>
        On the one hand, there are the approaches based on combining some traditional machine learning
model, such as Naive Bayes, SVM, Random Forest among others, with the extraction of features using
character and word n-grams calculated from the Term Frequency - Inverse Document Frequency
(TFIDF) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. On the other hand, there are the approaches based on deep learning and the use
of different neural architectures to learn abstract feature representation from the input texts [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ],
[
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
      </p>
    </sec>
    <sec id="sec-3">
      <title>Corpus 3.2.</title>
    </sec>
    <sec id="sec-4">
      <title>Preprocessing</title>
    </sec>
    <sec id="sec-5">
      <title>3. Our Method</title>
      <p>
        This section presents the dataset and the models utilized in the experimentation. For this we have
used python and toolkits of emoji2, keras [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], sklearn [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], tensorflow [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] and xgboost [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ].
      </p>
      <p>The corpus of this task is composed of two sub corpuses, one of them with tweets in English and the
other with tweets in Spanish. In addition, each sub corpus contains 200 XML files, which correspond
to the authors, and each file contains 200 tweets from an author. It should be noted that tweets have
been pre-cleaned, and hashtags, URLs and user mention in tweets have been converted to regulated
tags.</p>
      <p>Firstly, we have grouped in a single chain all the tweets belong to the author, so there are 200 samples
per corpus and then some preprocessing strategy applies to them.</p>
      <p>
        Consequently, we have based on the preprocessing method of Pizarro [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], the winner of Author
Profiling Task at PAN 2020 [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], which consist of determining if maintain letter case of the characters,
replace repeated character sequences, replace digits by a tag, replace emojis by words representations
and replace the regulated tags by other anonymized tags or eliminate it.
2 Emoji https://github.com/carpedm20/emoji/
      </p>
      <p>In our experimentation we have developed different types of machine learning models such as
support vector machines (SVM), random forest (RF), XGBoost classifiers (XGB) and a neuronal model
based on pre-trained BERT transformer.</p>
      <p>Relative to SVM, RF and XGB models, it should be noted that these models are being trained using
features of character and word n-grams calculated from the TF-IDF of each author. In addition, we have
run a grid search to find the best preprocessing and vectorization strategy and combination of
hyperparameters for the models.</p>
      <p>For the finetuning of the SVM model, we have applied different types of kernel and various values
of hyperparameter C.</p>
      <p>Regarding the random forest (RF) model, we have experimented with the quantity of trees in the
forest, the criteria for measuring the quality of partitions and the minimum number of samples required
to partition an internal node.</p>
      <p>Relative to XGBoost classifier, we have tested with the number of estimators, the learning rate, and
the maximum depth of a tree.</p>
      <p>
        On the other hand, regarding the pre-trained BERT [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] model, we have used its own data
preprocessing and encoder to generate the embeddings of the tweets. Furthermore, we have added an
additional dense layer between the encoder output and the output layer of the classifier. Therefore, we
have experimented with the number of neurons of the middle layer and the dropout to apply to the
output of the encoder layer.
      </p>
    </sec>
    <sec id="sec-6">
      <title>4. Results</title>
      <p>In the training phase, we have used a 10-fold cross validation strategy to finetune the parameters of
models and to select the best of them. Therefore, in the table 7 is shown estimated accuracies of each
model.</p>
    </sec>
    <sec id="sec-7">
      <title>5. Conclusions</title>
      <p>
        In this paper, we summarized the submitted models through the TIRA platform [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] for the Profiling
Hate Speech Spreaders on Twitter task [18] at PAN 2021 [19]. These consist of SVM as classifier, and
TF-IDF of word n-grams feature for Spanish tweets, and char n-grams for English authors. Regarding
the presented results in the notebook, we draw the following conclusions.
      </p>
      <p>Firstly, it is worth noting the great influence that cleaning and tokenizing data has on the operation
of classic classification models, we observed that for each language we have to tune specifically the
preprocessing strategy used.</p>
      <p>Relative to obtained results in the training phase with 10-fold cross validation strategy, we
contemplate that SVM model gives the best accuracy in both languages. In addition, we see neural
model BERT provides the worst performance probably due to the small quantity of data.</p>
      <p>Finally, comparing the results obtained in the training phase with the estimation made in the training
phase, we observed that with Spanish tweets we have made a good estimate of the accuracy whereas
with English we find a small difference.</p>
    </sec>
    <sec id="sec-8">
      <title>6. References</title>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Kemp</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <source>Digital</source>
          <year>2020</year>
          :
          <article-title>3.8 billion people use social media - We Are Social</article-title>
          .
          <source>We Are Social [online]</source>
          .
          <year>2020</year>
          . Avalaible in: https://wearesocial.com/blog/2020/01/digital-2020-3
          <article-title>-8-billionpeople-use-social-media.</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>MacAvaney</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          &amp;
          <string-name>
            <surname>Yao</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          &amp;
          <string-name>
            <surname>Yang</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          &amp;
          <string-name>
            <surname>Russell</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          &amp;
          <string-name>
            <surname>Goharian</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          &amp;
          <string-name>
            <surname>Frieder</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          (
          <year>2019</year>
          ).
          <article-title>Hate speech detection: Challenges and solutions</article-title>
          .
          <source>PloS one</source>
          .
          <volume>14</volume>
          .
          <year>e0221152</year>
          .
          <volume>10</volume>
          .1371/journal.pone.
          <volume>0221152</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Burnap</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Williams</surname>
            ,
            <given-names>M. L.</given-names>
          </string-name>
          :
          <article-title>Cyber hate speech on twitter: An application of machine classification and statistical modeling for policy and decision making</article-title>
          .
          <source>Policy and Internet</source>
          ,
          <volume>7</volume>
          (
          <issue>2</issue>
          ):
          <fpage>223</fpage>
          -
          <lpage>242</lpage>
          ,
          <year>2015</year>
          . doi:
          <volume>10</volume>
          .1002/poi3.
          <fpage>85</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Greevy</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Smeaton</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Classifying racist texts using a support vector machine</article-title>
          .
          <source>In Proceedings of the 27th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR '04</source>
          , pages
          <fpage>468</fpage>
          -
          <lpage>469</lpage>
          , New York, NY, USA,
          <year>2004</year>
          . ACM. doi:
          <volume>10</volume>
          .1145/1008992.1009074.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Davidson</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Warmsley</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Macy</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Weber</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Automated hate speech detection and the problem of offensive language</article-title>
          .
          <source>In Proceedings of the 11th Conference on Web and Social Media</source>
          , Menlo Park, California, United States,
          <year>2017</year>
          .
          <article-title>Association for the Advancement of Artificial Intelligence</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Gröndahl</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pajola</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Juuti</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Conti</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Asokan</surname>
          </string-name>
          :
          <year>2018</year>
          .
          <article-title>All You Need is "Love": Evading Hate Speech Detection</article-title>
          .
          <source>In Proceedings of the 11th ACM Workshop on Artificial Intelligence and Security (AISec '18)</source>
          .
          <article-title>Association for Computing Machinery</article-title>
          , New York, NY, USA,
          <fpage>2</fpage>
          -
          <lpage>12</lpage>
          . DOI:https://doi.org/10.1145/3270101.3270103.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Pitsilis</surname>
            ,
            <given-names>G.K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ramampiaro</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          &amp;
          <string-name>
            <surname>Langseth</surname>
          </string-name>
          , H.:
          <article-title>Effective hate-speech detection in Twitter data using recurrent neural networks</article-title>
          .
          <source>Appl Intell</source>
          <volume>48</volume>
          ,
          <fpage>4730</fpage>
          -
          <lpage>4742</lpage>
          (
          <year>2018</year>
          ). https://doi.org/10.1007/s10489-018-1242-y.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Raghad</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          &amp;
          <string-name>
            <surname>Hend</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          : (
          <year>2020</year>
          ).
          <article-title>A Deep Learning Approach for Automatic Hate Speech Detection in the Saudi Twittersphere</article-title>
          .
          <source>Applied Sciences. 10. 8614. 10</source>
          .3390/app10238614.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Ziqi</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          &amp;
          <string-name>
            <surname>Lei</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :(
          <year>2018</year>
          ).
          <article-title>Hate Speech Detection: A Solved Problem? The Challenging Case of Long Tail on Twitter</article-title>
          .
          <source>Semantic Web. Accepted</source>
          .
          <volume>10</volume>
          .3233/SW-180338.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Chollet</surname>
          </string-name>
          , François and others.
          <source>: Keras</source>
          .
          <year>2015</year>
          . Available in: https://keras.io.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Pedregosa</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gaël</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Alexander</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vincent</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bertrand</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Oliver</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mathieu</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Peter</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ron</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vincent</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jake</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Alexandre</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>David</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Matthieu</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Matthieu</surname>
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Édouard</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Scikit- learn: Machine learning in Python</article-title>
          .
          <source>Journal of Machine Learning Research</source>
          .
          <year>2011</year>
          ,
          <volume>12</volume>
          .
          <fpage>2825</fpage>
          -
          <lpage>2830</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <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>
          &amp;
          <string-name>
            <surname>others</surname>
          </string-name>
          (
          <year>2016</year>
          ).
          <article-title>TensorFlow: A System for Large-Scale Machine Learning</article-title>
          .
          <source>OSDI</source>
          (p./pp.
          <fpage>265</fpage>
          -
          <lpage>283</lpage>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Guestrin</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          (
          <year>2016</year>
          ).
          <article-title>XGBoost: A Scalable Tree Boosting System</article-title>
          .
          <source>In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining</source>
          (pp.
          <fpage>785</fpage>
          -
          <lpage>794</lpage>
          ). New York, NY, USA: ACM. https://doi.org/10.1145/2939672.2939785.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <surname>Pizarro</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          :
          <article-title>Using N-grams to detect Fake News Spreaders on Twitter</article-title>
          . In: Cappellato,
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Eickhoff</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Ferro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            ,
            <surname>Névéol</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          . (eds.)
          <article-title>CLEF 2020 Labs and Workshops, Notebook Papers</article-title>
          .
          <source>CEUR-WS.org (Sep</source>
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>Rangel</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Giachanou</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ghanem</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosso</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Overview of the 8th Author Profiling Task at PAN 2020: Profiling Fake News Spreaders on Twitter</article-title>
          . In: Cappellato,
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Eickhoff</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Ferro</surname>
          </string-name>
          , N.,
          <string-name>
            <surname>N</surname>
          </string-name>
          ´ev´eol, A. (eds.)
          <article-title>CLEF 2020 Labs and Workshops, Notebook Papers</article-title>
          .
          <source>CEUR-WS.org (Sep</source>
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <surname>Devlin</surname>
            <given-names>J</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chang</surname>
            <given-names>MW</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lee</surname>
            <given-names>K</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Toutanova</surname>
            <given-names>K. BERT</given-names>
          </string-name>
          :
          <article-title>Pre-training of Deep Bidirectional Transformers for Language Understanding</article-title>
          . arXiv:
          <volume>181004805</volume>
          [cs].
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <surname>Potthast</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gollub</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wiegmann</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stein</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>TIRA Integrated Research Architecture</article-title>
          . In: Ferro,
          <string-name>
            <given-names>N.</given-names>
            ,
            <surname>Peters</surname>
          </string-name>
          ,
          <string-name>
            <surname>C</surname>
          </string-name>
          . (eds.)
          <article-title>Information Retrieval Evaluation in a Changing World</article-title>
          . Springer (Sep
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>