<!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>NLP-CIC at HASOC 2020: Multilingual Ofensive Language Detection using All-in-one Model</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Segun Taofeek Aroyehun</string-name>
          <email>aroyehun.segun@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alexander Gelbukh</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>CIC, Instituto Politécnico Nacional Mexico City</institution>
          ,
          <country country="MX">Mexico</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>FIRE '20, Forum for Information Retrieval Evaluation</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>We describe our deep learning model submitted to the HASOC 2020 shared task on detection of ofensive language in social media in three Indo-European languages: English, German, and Hindi. We finetune a pre-trained multilingual encoder on the combination of data provided for the competition. Our submission received a competitive macro- average F1 score of 0.4980 on the English Subtask A as well as comparatively strong performance on the German data.</p>
      </abstract>
      <kwd-group>
        <kwd>ofensive content identification</kwd>
        <kwd>deep learning</kwd>
        <kwd>text classification</kwd>
        <kwd>multilingual</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>The impact of ofensive content on web users range from subtle uneasiness to graver
psychological and emotional distress which if go unchecked can result in violent actions to/from
afected individuals. In order to make the web a safe place for all, platforms such as Twitter and
Facebook pay close attention to content moderation. To aid in the arduous task of removal of
objectionable content, it becomes necessary to build eficient and efective systems capable of
identifying and classifying such content for automatic or human-assisted content moderation.
A standard approach is to automatically flag such content for removal or review by human
moderators. There are several studies on the English language due to availability of datasets
and distributional representation with which models can be developed. While there is sizeable
progress in the English language, the same cannot be said of other languages. With shared
task series such as HASOC providing data in other languages, this provides avenue for further
research in other languages. With the availability of datasets in several languages, it becomes
expensive to design a robust system for each language. An alternative strategy will be to train
a single model on languages for which annotated data is available.</p>
      <p>
        We base our approach on the recent progress in the development of multilingual language
models. In particular, the observation by Conneau et al. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] that a multilingual model can
reach the performance of several language-specific models, at least after pre-training. Can we
say the same for fine-tuning on a downstream task? We examine whether jointly fine-tuning
a multilingual model on a multilingual dataset is feasible for the task of ofensive content
www.gelbukh.com (A. Gelbukh)
      </p>
      <p>© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
identification and classification. We reckon that this approach will be more energy eficient and
less computationally expensive.</p>
      <p>
        Specifically, we examine the possibility of using a multilingual pre-trained language model
(BERT) to train a single model for the three languages with datasets provided for the HASOC
2020 shared task [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] via transfer learning.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>
        The automatic detection of ofensive content has been studied with several approaches.
Traditionally, feature engineering in conjunction with classical machine learning models such
as Support Vector Machines, Logistic Regression, and Naive Bayes have shown competitive
performance [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. In recent times, neural networks have outperformed the traditional approaches
using architectures such as GRU, LSTM, and CNN in combination with word embeddings [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
The introduction of contextual word embeddings based on pre-trained language models [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]
and the transformers [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] architecture has led to state-of-the-art results on several NLP tasks
including ofensive content identification [ 7]. Typically, existing approaches rely on pre-trained
language models which are adapted to the task at hand [8]. There has been significant progress
on the detection of ofensive content in English language and the same cannot be said of other
languages. Recently, shared tasks such as TRAC 2018 [9], HASOC 2019 [10], TRAC 2020 [11],
and Ofenseval [ 12] have introduced datasets in languages other than English. However, the
evaluation at those venues still proceeds on a monolingual level. It would be interesting to see
evaluation settings that assess models on their multilingual and/or cross-lingual capabilities as
exemplified in the work of Pamungkas and Patti [ 13] and Ranasinghe and Zampieri [14].
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Methodology</title>
      <p>Task. Given a text (tweets in this case) predict (1) For subtask A, whether it is ofensive or
not. and (2) For subtask B, categorize the text into one of the following classes: none, ofensive,
hate, and profane.</p>
      <p>Data. The HASOC 2020 dataset includes annotated text data in English, German, and Hindi.
The data has hierarchical labels at two levels. Level one has binary labels (Ofensive VS. Not
ofensive) and level two has four mutually exclusive labels. Table 1 shows the details of the
training set.</p>
      <p>Approach. We train a single model using the combination of labeled datasets provided for
each language by the organizers. So, we have a single model per task which covers the three
languages covered by the competition.</p>
      <p>
        We use as validation set the test set for the 2019 edition of HASOC (the gold labels). We
observe that the application of language-agnostic pre-processing: URL removal, normalization
of repeated characters, emoji to text conversion, and removal of punctuation marks resulted
in performance drop on the validation set. Hence, we did not apply pre-processing to our
submissions. It appears that a contextual model such as BERT is able to utilize the information
that would have been removed. We experiment with both multilingual BERT [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and XLM-R
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. We find that the performance of the XLM-R model was unstable and inferior across runs.
This is likely due to the size of the model and thus requires careful fine-tuning. Based on this
observation, we select multilingual BERT for our submissions. We use as representation for
the text the embedding of the [CLS] token, which is of dimension 768 and feed this to a single
layer perceptron with softmax activation. This gives a probability distribution over the number
of classes to be predicted (2 for subtask A and 4 for subtask B). Our training set up use the
following hyperparameter settings: learning rate of 3 − 5 , batch size of 128, Adam as optimizer,
and a maximum of 5 epochs. We select the model with the best performance on the validation
set for prediction on the unseen test set. For subtask B, we continue fine-tuning on the best
model from subtask A using the same hyperparameter settings above. Our implementation
uses the Flair library [15].
      </p>
    </sec>
    <sec id="sec-4">
      <title>4. Results</title>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>We examined the feasibility of using a single multilingual model to detect and classify ofensive
language in three Indo-European languages. We run fine-tuning experiments using multilingual
BERT. We record a competitive macro-average F1 score of 0.4980 on the English subtask A. We
observe that the performance gaps between our submission for tasks on Hindi and the best
model on the leaderboard is the highest. In the future, we will like to experiment further with a
mixture of more language-specific datasets and identify the limits of using a mixed-language
dataset for fine-tuning multilingual encoders on the task of ofensive content identification.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>We thank the competition organizers for their support. The authors thank CONACYT for the
computer resources provided through the INAOE Supercomputing Laboratory’s Deep Learning
Platform for Language Technologies.
formation Processing Systems 30, Curran Associates, Inc., 2017, pp. 5998–6008. URL:
http://papers.nips.cc/paper/7181-attention-is-all-you-need.pdf.
[7] J. Risch, R. Krestel, Bagging bert models for robust aggression identification, in:
Proceedings of the Second Workshop on Trolling, Aggression and Cyberbullying, 2020, pp.
55–61.
[8] C. Sun, X. Qiu, Y. Xu, X. Huang, How to fine-tune bert for text classification?, in: China</p>
      <p>National Conference on Chinese Computational Linguistics, Springer, 2019, pp. 194–206.
[9] R. Kumar, A. K. Ojha, S. Malmasi, M. Zampieri, Benchmarking aggression identification
in social media, in: Proceedings of the First Workshop on Trolling, Aggression and
Cyberbullying (TRAC-2018), 2018, pp. 1–11.
[10] T. Mandl, S. Modha, P. Majumder, D. Patel, M. Dave, C. Mandlia, A. Patel, Overview of the
hasoc track at fire 2019: Hate speech and ofensive content identification in indo-european
languages, in: Proceedings of the 11th Forum for Information Retrieval Evaluation, 2019,
pp. 14–17.
[11] R. Kumar, A. K. Ojha, S. Malmasi, M. Zampieri, Evaluating aggression identification
in social media, in: Proceedings of the Second Workshop on Trolling, Aggression and
Cyberbullying, European Language Resources Association (ELRA), Marseille, France, 2020,
pp. 1–5. URL: https://www.aclweb.org/anthology/2020.trac-1.1.
[12] M. Zampieri, P. Nakov, S. Rosenthal, P. Atanasova, G. Karadzhov, H. Mubarak, L.
Derczynski, Z. Pitenis, Ç. Çöltekin, Semeval-2020 task 12: Multilingual ofensive language
identification in social media (ofenseval 2020), arXiv preprint arXiv:2006.07235 (2020).
[13] E. W. Pamungkas, V. Patti, Cross-domain and cross-lingual abusive language detection: A
hybrid approach with deep learning and a multilingual lexicon, in: Proceedings of the
57th Annual Meeting of the Association for Computational Linguistics: Student Research
Workshop, Association for Computational Linguistics, Florence, Italy, 2019, pp. 363–370.</p>
      <p>URL: https://www.aclweb.org/anthology/P19-2051. doi:1 0 . 1 8 6 5 3 / v 1 / P 1 9 - 2 0 5 1 .
[14] T. Ranasinghe, M. Zampieri, Multilingual ofensive language identification with
crosslingual embeddings, arXiv preprint arXiv:2010.05324 (2020).
[15] A. Akbik, D. Blythe, R. Vollgraf, Contextual string embeddings for sequence labeling,
in: COLING 2018, 27th International Conference on Computational Linguistics, 2018, pp.
1638–1649.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Conneau</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Khandelwal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Goyal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Chaudhary</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Wenzek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Guzmán</surname>
          </string-name>
          , E. Grave,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ott</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Zettlemoyer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Stoyanov</surname>
          </string-name>
          ,
          <article-title>Unsupervised cross-lingual representation learning at scale, in: Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, Association for Computational Linguistics</article-title>
          , Online,
          <year>2020</year>
          , pp.
          <fpage>8440</fpage>
          -
          <lpage>8451</lpage>
          . URL: https://www.aclweb.org/anthology/2020.acl-main.
          <source>747. doi:1 0 . 1 8</source>
          <volume>6 5 3</volume>
          / v 1 /
          <article-title>2 0 2 0 . a c l - m a i n . 7 4 7</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <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="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>S.</given-names>
            <surname>Malmasi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Zampieri</surname>
          </string-name>
          ,
          <article-title>Detecting hate speech in social media</article-title>
          ,
          <source>in: Proceedings of Recent Advances in Natural Language Processing (RANLP)</source>
          , Varna, Bulgaria,
          <year>2017</year>
          , pp.
          <fpage>467</fpage>
          -
          <lpage>472</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>S. T.</given-names>
            <surname>Aroyehun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Gelbukh</surname>
          </string-name>
          ,
          <article-title>Aggression detection in social media: Using deep neural networks, data augmentation, and pseudo labeling</article-title>
          ,
          <source>in: Proceedings of the First Workshop on Trolling, Aggression and Cyberbullying (TRAC-2018)</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>90</fpage>
          -
          <lpage>97</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>J.</given-names>
            <surname>Devlin</surname>
          </string-name>
          , M.-
          <string-name>
            <given-names>W.</given-names>
            <surname>Chang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Lee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Toutanova</surname>
          </string-name>
          , BERT:
          <article-title>Pre-training of deep bidirectional transformers for language understanding</article-title>
          ,
          <source>in: Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies</source>
          , Volume
          <volume>1</volume>
          (Long and Short Papers),
          <source>Association for Computational Linguistics</source>
          , Minneapolis, Minnesota,
          <year>2019</year>
          , pp.
          <fpage>4171</fpage>
          -
          <lpage>4186</lpage>
          . URL: https://www.aclweb.
          <source>org/ anthology/N19-1423. doi:1 0 . 1 8</source>
          <volume>6 5 3</volume>
          / v 1 / N 1 9
          <article-title>- 1 4 2 3</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Vaswani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Shazeer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Parmar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Uszkoreit</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Jones</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. N.</given-names>
            <surname>Gomez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Kaiser</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Polosukhin</surname>
          </string-name>
          ,
          <article-title>Attention is all you need</article-title>
          , in: I. Guyon,
          <string-name>
            <given-names>U. V.</given-names>
            <surname>Luxburg</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Bengio</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Wallach</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Fergus</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Vishwanathan</surname>
          </string-name>
          , R. Garnett (Eds.), Advances in Neural In-
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>