<!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>Multilingual Hate Speech and Ofensive Content Identification based on XLM-RoBERTa</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Xiaozhi Ou</string-name>
          <email>xiaozhiou88@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Hongling Li</string-name>
          <email>honglingli66@126.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>School of Information Science and Engineering, Yunnan University</institution>
          ,
          <addr-line>Kunming, 650500, Yunnan</addr-line>
          ,
          <country country="CN">P.R. China</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2020</year>
      </pub-date>
      <fpage>16</fpage>
      <lpage>20</lpage>
      <abstract>
        <p>This article introduces the submission of subtask A in three languages (English, German, Hindi) that we participated in the HASOC 2020 shared task, which aims to target hate speech and ofensive language in multiple languages for identification. To solve this task, we propose a system based on the multilingual model XLM-RoBERTa and Ordered Neurons LSTM (ON-LSTM). When evaluated on the oficial test set, our system show the efectiveness of our method on subtask A of three languages. The Macro average F1 score of English subtask A is 0.5006, the Macro average F1 score of German subtask A is 0.5177, the Macro average F1 score of Hindi subtask A is 0.5200. This final leaderboard result is calculated with approximately 15% of the private test data.</p>
      </abstract>
      <kwd-group>
        <kwd>multilingual</kwd>
        <kwd>hate speech</kwd>
        <kwd>ofensive language</kwd>
        <kwd>identification</kwd>
        <kwd>English</kwd>
        <kwd>German</kwd>
        <kwd>Hindi</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>The existence and impact of hate speech and ofensive language on social media platforms are
becoming a major concern in modern society. Given the enormous amount of content created
every day, automated methods are needed to detect and handle such content. So far, most
studies have focused on solving the problem for the English language, while the problem is
CEUR
Workshop
Proceedings</p>
      <p>We participate in subtask A for three languages: this task focuses on Hate speech and
Ofensive language identification ofered for English, German, and Hindi. Subtask A is a
coarsegrained binary classification in which participating systems are required to classify tweets into
two classes, namely: Hate and Ofensive (HOF) and Non-Hate and ofensive (NOT). HOF refers
to posts that contain Hate, ofensive, and profane content, and NOT refers to posts that do not
contain such content.</p>
      <p>In order to efectively solve this task and achieve better results in low-resource languages,
we focus on the approach to an efective strategy of combining the multilingual model
XLMRoBERTa with Ordered Neurons LSTM (ON-LSTM). Firstly, we are base on the pre-trained
multi-language model XLM-RoBERTa, it not only inherits the training method of XLM also
uses the ideas of RoBERTa for reference. Then, we use the ON-LSTM, It obtains hierarchical
structure information by sorting neurons, which can express richer semantic information. In
this paper, we present the related work, the details of our approach, our results and conclusion.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>
        From an NLP perspective, the topics of hate speech and ofensive language and all its possible
facets and related phenomena (such as profane/abusive language) and its identification have
attracted great attention. His is shown by the proliferation, especially in the last few years, of
contributions on this matter ([
        <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>
        ] to name a few), corpora and lexica (e.g. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ],
[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]), dedicated workshops, and shared tasks within national (GermEval4, EVALITA5, IberLEF6)
and international (SemEval7) evaluation campaigns (see in particular [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]). In the literature
on the ofensive and hate language detection, many diferent subtasks have been considered,
ranging from general ofensive language detection to more refined tasks, such as hate speech
detection [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] and cyberbullying detection [11]. Chen et al. applied the concept of NLP to
develop sentence lexical and syntactic features for ofensive language detection [ 12]. Huang et
al. integrated the textual features with social network features, which significantly improved
cyberbullying detection [13].
      </p>
      <p>
        Unfortunately, other supervised methods to hate speech classification have conflated hate
speech with ofensive language, which makes it dificult to determine to what extent they actually
recognize hate speech [14]. Neural language models show promise in the task but existing work
has used training data that has a similarly broad definition of hate speech [ 15]. Non-linguistic
features like gender or ethnicity of the author can help improve hate speech classification but
this information is often unavailable or unreliable on social media [ 16]. Recently, Zampieri et al.
provided an ofensive language identification dataset, which aims to identify the type and target
of ofensive posts in social media [ 17]. This year they expanded the dataset to a multilingual
version, thus promoting multilingual research in this field [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. Pre-trained language models,
such as BERT [18] and ELMo [19] have achieved great performance on a variety of tasks. Many
recent papers have used basic methods of fine-tuning such pre-trained models in certain fields
      </p>
      <sec id="sec-2-1">
        <title>4https://projects.fzai.h-da.de/iggsa/germeval/ 5http://www.evalita.it/2020/tasks 6http://hitz.eus/sepln2019/?q=node/21 7http://alt.qcri.org/semeval2020/index.php?id=tasks</title>
        <p>[20] or downstream tasks [21].</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Approach</title>
      <p>In this chapter, we will description of the data, system, and experimental parameters we use.</p>
      <sec id="sec-3-1">
        <title>3.1. Data description</title>
        <p>The HASOC organizers provided complete training datasets for the three languages, with about
3,708 in English, about 2,373 in German, and about 2,963 in Hindi. In our experiment, we use
the multi-task learning method to combine the training datasets of the three languages and
train the model to share the representations between related tasks to solve the subtask A of the
three languages, but it did not achieve our expected efect. Finally, we use the HASOC 2019
dataset to merge the datasets of the three languages, respectively. Such as the final English
training set is the combination of the HASOC 2019 English training dataset and the HASOC
2020 English training dataset (The same goes for other languages).</p>
        <p>In our experiment, we use stratified sampling technology (StratifiedKFold) to randomly
split all combined training datasets. As shown in Figure 1, we using StratifiedKFold
crossvalidation instead of ordinary k-fold cross-validation to evaluate a classifier. The reason is that
StratifiedKFold can utilize stratified sampling to divide, which can ensure that the proportion of
each category in the generated training set and validation set is consistent with the original
training set so that the generated data distribution disorder will not occur. In the experiment,
we use 5-fold stratified sampling.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. System description</title>
        <p>The pre-training of XLM-RoBERTa is based on 100 languages, using more than 2TB of
preprocessed CommonCrawl dataset to train cross-language representations in a self-supervised
manner. XLM-RoBERTa [22] shows that the use of large-scale multi-language pre-training
models can significantly improve the performance of cross-language migration tasks. In order
to solve the subtask A of three languages at the same time, we propose a system architecture
based on the multi-language model XLM-RoBERTa as shown in Figure 2. Firstly, we get pooler
output (P_O), P_O is the pooler output of XLM-Roberta. It is obtained by its last layer hidden
state of the first token of the sequence (CLS token) further processed by a linear layer and a
tanh activation function. Then extract the hidden state of the last four layers of XLM-RoBERTa
and input them into Ordered Neurons LSTM (ON-LSTM) [23]. Finally, we concatenate the P_O
and output of ON-LSTM together input into the Classifier for the final classification.</p>
      </sec>
      <sec id="sec-3-3">
        <title>3.3. Experimental parameters</title>
        <p>In our experiment, we did not clean the data. We use XLM-RoBERTa-base8 pre-trained model.
The batch size is set to 32 and the max sequence length is set to 150. We extract the last
four hidden layer state of XLM-RoBERTa by setting the output hidden States is true. For the
ON-LSTM, we set the hidden units to 512 and num levels to 1. We use binary cross-entropy,
adam optimizer and learning rate to 5e-5. The model is trained in 10 epochs.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Result</title>
      <p>This section will show the results and analysis of all three languages that we participated
in subtask A on the test set and the oficial 15% private test set, the subtask A for the three
languages is evaluated by following the macro average F1 of scikit-learn9. The test set results
of subtask A in all three languages are shown in Table 1. For each language subtask A, we
have performed three runs. Among them, Run_1 means we take the P_O of XLM-RoBERTa as
the final output. Run_2 means that we extract the last four hidden layers of XLM-RoBERTa
and input them into the convolution neural network (CNN) and K-max pooling. Run_3 means
that we extract the last four hidden layers of XLM-RoBERTa and input them into ON-LSTM,
which is also the system we finally submitted. Table 2 reports the oficial results of the best run</p>
      <sec id="sec-4-1">
        <title>8https://huggingface.co/xlm-roberta-base</title>
        <p>9https://scikit-learn.org/stable/modules/generated/sklearn.metrics.f1_score.html
of subtask A in the three languages we participated in, we can also see the best scores of the
oficial leaderboard and our ranking.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>In the experiment, we test the efects of using the external dataset and not using the external
dataset. Our conclusion is that using data from the same language for training and test is a
necessary condition for good performance. In addition, adding data from diferent languages
can improve results.
[11] C. Van Hee, B. Verhoeven, E. Lefever, G. De Pauw, W. Daelemans, V. Hoste, Guidelines for
the fine-grained analysis of cyberbullying, version 1.0, LT3 Technical Report Series (2015).
[12] Y. Chen, Y. Zhou, S. Zhu, H. Xu, Detecting ofensive language in social media to protect
adolescent online safety, in: 2012 International Conference on Privacy, Security, Risk and
Trust and 2012 International Confernece on Social Computing, IEEE, 2012, pp. 71–80.
[13] Q. Huang, V. K. Singh, P. K. Atrey, Cyber bullying detection using social and textual analysis,
in: Proceedings of the 3rd International Workshop on Socially-Aware Multimedia, 2014,
pp. 3–6.
[14] P. Burnap, M. L. Williams, Cyber hate speech on twitter: An application of machine
classification and statistical modeling for policy and decision making, Policy &amp; Internet 7
(2015) 223–242.
[15] N. Djuric, J. Zhou, R. Morris, M. Grbovic, V. Radosavljevic, N. Bhamidipati, Hate speech
detection with comment embeddings, in: Proceedings of the 24th international conference
on world wide web, 2015, pp. 29–30.
[16] Z. Waseem, D. Hovy, Hateful symbols or hateful people? predictive features for hate
speech detection on twitter, in: Proceedings of the NAACL student research workshop,
2016, pp. 88–93.
[17] M. Zampieri, S. Malmasi, P. Nakov, S. Rosenthal, N. Farra, R. Kumar, Predicting the type
and target of ofensive posts in social media, arXiv preprint arXiv:1902.09666 (2019).
[18] J. Devlin, M.-W. Chang, K. Lee, K. Toutanova, Bert: Pre-training of deep bidirectional
transformers for language understanding, arXiv preprint arXiv:1810.04805 (2018).
[19] M. E. Peters, M. Neumann, M. Iyyer, M. Gardner, C. Clark, K. Lee, L. Zettlemoyer, Deep
contextualized word representations, arXiv preprint arXiv:1802.05365 (2018).
[20] N. Azzouza, K. Akli-Astouati, R. Ibrahim, Twitterbert: Framework for twitter sentiment
analysis based on pre-trained language model representations, in: International Conference
of Reliable Information and Communication Technology, Springer, 2019, pp. 428–437.
[21] Z. Liu, G. I. Winata, Z. Lin, P. Xu, P. Fung, Attention-informed mixed-language training for
zero-shot cross-lingual task-oriented dialogue systems, arXiv preprint arXiv:1911.09273
(2019).
[22] A. Conneau, K. Khandelwal, N. Goyal, V. Chaudhary, V. Stoyanov, Unsupervised
crosslingual representation learning at scale, in: Proceedings of the 58th Annual Meeting of
the Association for Computational Linguistics, 2020.
[23] Y. Shen, S. Tan, A. Sordoni, A. Courville, Ordered neurons: Integrating tree structures into
recurrent neural networks (2018).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>T.</given-names>
            <surname>Mandl</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Modha</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G. K.</given-names>
            <surname>Shahi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. K.</given-names>
            <surname>Jaiswal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Nandini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Patel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Majumder</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Schäfer</surname>
          </string-name>
          ,
          <article-title>Overview of the HASOC track at FIRE 2020: Hate Speech and Ofensive Content Identification in Indo-European Languages)</article-title>
          ,
          <source>in: Working Notes of FIRE 2020 - Forum for Information Retrieval Evaluation</source>
          ,
          <string-name>
            <surname>CEUR</surname>
          </string-name>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Bohra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Vijay</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Singh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. S.</given-names>
            <surname>Akhtar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Shrivastava</surname>
          </string-name>
          ,
          <article-title>A dataset of hindi-english code-mixed social media text for hate speech detection</article-title>
          ,
          <source>in: Proceedings of the Second Workshop on Computational Modeling of People's Opinions</source>
          , Personality, and Emotions in Social Media,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>D.</given-names>
            <surname>Jurgens</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Chandrasekharan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Hemphill</surname>
          </string-name>
          ,
          <article-title>A just and comprehensive strategy for using nlp to address online abuse (</article-title>
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>T.</given-names>
            <surname>Caselli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Basile</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Mitrović</surname>
          </string-name>
          , I. Kartoziya,
          <string-name>
            <given-names>M.</given-names>
            <surname>Granitzer</surname>
          </string-name>
          ,
          <article-title>I feel ofended, don't be abusive! implicit/explicit messages in ofensive and abusive language</article-title>
          ,
          <source>in: Proceedings of The 12th Language Resources and Evaluation Conference</source>
          ,
          <year>2020</year>
          , pp.
          <fpage>6193</fpage>
          -
          <lpage>6202</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>P.</given-names>
            <surname>Fortuna</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. R.</surname>
          </string-name>
          <article-title>da</article-title>
          <string-name>
            <surname>Silva</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <string-name>
            <surname>Wanner</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Nunes</surname>
          </string-name>
          , et al.,
          <article-title>A hierarchically-labeled portuguese hate speech dataset</article-title>
          ,
          <source>in: Proceedings of the Third Workshop on Abusive Language Online</source>
          ,
          <year>2019</year>
          , pp.
          <fpage>94</fpage>
          -
          <lpage>104</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>E.</given-names>
            <surname>Bassignana</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Basile</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Patti</surname>
          </string-name>
          ,
          <article-title>Hurtlex: A multilingual lexicon of words to hurt</article-title>
          ,
          <source>in: 5th Italian Conference on Computational Linguistics</source>
          , CLiC-it
          <year>2018</year>
          , volume
          <volume>2253</volume>
          ,
          <string-name>
            <surname>CEUR-WS</surname>
          </string-name>
          ,
          <year>2018</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>6</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>S.</given-names>
            <surname>Rosenthal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Atanasova</surname>
          </string-name>
          , G. Karadzhov,
          <string-name>
            <given-names>M.</given-names>
            <surname>Zampieri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Nakov</surname>
          </string-name>
          ,
          <article-title>A large-scale semisupervised dataset for ofensive language identification</article-title>
          , arXiv preprint arXiv:
          <year>2004</year>
          .
          <volume>14454</volume>
          (
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>M.</given-names>
            <surname>Sanguinetti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Poletto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Bosco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Patti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Stranisci</surname>
          </string-name>
          ,
          <article-title>An italian twitter corpus of hate speech against immigrants</article-title>
          ,
          <source>in: Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC</source>
          <year>2018</year>
          ),
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Zampieri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Nakov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Rosenthal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Atanasova</surname>
          </string-name>
          , G. Karadzhov,
          <string-name>
            <given-names>H.</given-names>
            <surname>Mubarak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Derczynski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Pitenis</surname>
          </string-name>
          , Ç. Çöltekin, Semeval-2020 task 12:
          <article-title>Multilingual ofensive language identification in social media</article-title>
          (ofenseval
          <year>2020</year>
          ), arXiv preprint arXiv:
          <year>2006</year>
          .
          <volume>07235</volume>
          (
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <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>arXiv preprint arXiv:1703.04009</source>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>