<!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>
      <journal-title-group>
        <journal-title>B. Ray); avishekgarain@gmail.com (A. Garain)</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>JU at HASOC 2020: Deep Learning with RoBERTa and Random Forest for Hate Speech and Offensive Content Identification in Indo-European Languages</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Biswarup Ray</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Avishek Garain</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science and Engineering, Jadavpur University</institution>
          ,
          <addr-line>Kolkata-700032, West Bengal</addr-line>
          ,
          <country country="IN">India</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2020</year>
      </pub-date>
      <volume>000</volume>
      <fpage>0</fpage>
      <lpage>0001</lpage>
      <abstract>
        <p>The identification of Hate Speech in Social Media has received much attention in research recently. There has been an ever-growing increase in demand particularly for research in languages other than English. The Hate Speech and Offensive Content (HASOC) track has created resources for Hate Speech Identification in three different languages namely Hindi, German, and English. We have participated in both Sub-tasks A and B of the 2020 shared task on hate speech and offensive content identification in Indo-European languages. Our approach relies on a combined model of multilingual RoBERTa (a Robustly Optimized BERT Pretraining Approach) model with pre-trained vectors and a Random Forest model using Word2Vec, TF-IDF, and other textual features as input. Our system has achieved a maximum Macro F1-score of 50.28% for English Sub-task A which is quite satisfactory relative to the performance of other systems and secured 8th position among participating teams.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Hate Speech</kwd>
        <kwd>RoBERTa</kwd>
        <kwd>Random Forest</kwd>
        <kwd>TF-IDF</kwd>
        <kwd>Word2Vec</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Accuracy and efficiency of any supervised classification method are heavily dependent on the
corpora on which it is trained to make the dataset a very important entity for such classification
tasks. Hate Speech as such is a topic that has attracted the attention of researchers time and again
resulting in several previous initiatives of corpora creation [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. There has been significant work in
several languages, in particular for English. However, for languages other than English, such as
Hindi standard datasets are not available as such. There is a huge demand for resources for many
languages other than English. HASOC is such a shared task that developed a resource for three
languages altogether and which encourages attaining results in terms of multilingual research. In
this paper, we have proposed a model for the new HASOC task for hateful and offensive speech
classification on texts from three different languages (English, Hindi, and German). A combined
classifier model has been proposed, which uses the pre-trained multilingual model RoBERTa as
the base for the contextual word representations and a 2 class sentiment analysis task. Among the
2 classes, the Hate and Offensive class are further classified into 3 classes by a Random Forest
classifier using textual features as input features.
      </p>
      <p>The rest of the paper has been organized as follows. Section 2 describes the data on which the
task was performed. The methodology followed is described in Section 3. This is followed by the
results and concluding remarks in Section 4 and 5 respectively.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Data</title>
      <p>The corpus that has been used for this task contains texts in 3 different languages namely English,
German, and Hindi, and consists of 3794, 2452, and 2963 tweets respectively. We have divided
the dataset in the ratio 80:20 for training and validation purposes respectively. The distribution of
data instances is given in Tables 1 and 2.</p>
      <sec id="sec-2-1">
        <title>2.1. Sub-task A</title>
        <p>The three possible categories established in the dataset under this Sub-task are:
• (NOT) Non-Hate-Offensive - This post does not contain any Hate speech, profane, offensive
content.
• (HOF) Hate and Offensive - This post contains Hate, offensive, and profane content.</p>
        <sec id="sec-2-1-1">
          <title>Language</title>
          <p>English
German
Hindi</p>
        </sec>
        <sec id="sec-2-1-2">
          <title>Label</title>
          <p>NOT
HOF
All
NOT
HOF
All
NOT
HOF
All
• (OFFN) Offensive:- Posts under this class contain offensive content.
• (PRFN) Profane:- These posts contain profane words.</p>
        </sec>
        <sec id="sec-2-1-3">
          <title>Language</title>
          <p>English
German
Hindi</p>
        </sec>
        <sec id="sec-2-1-4">
          <title>Label</title>
          <p>HATE
OFFN
PRFN</p>
          <p>All
HATE
OFFN
PRFN</p>
          <p>All
HATE
OFFN
PRFN
All</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Methodology</title>
      <p>For HASOC Task, our method uses a RoBERTa model for classification of reviews in each
language into Hate and Offensive (HOF), Non- Hate, and offensive (NOT) sentiment labels. Then
a method based on a Random Forest classifier with Word2Vec embeddings and TF-IDF (Term
Frequency-Inverse Document Frequency) of commonly recurring words as input features were
used to further classify the HOF sentiment into (HATE) Hate speech, (OFFN) Offensive and
(PRFN) Profane. The workflow of our methodology is shown in Figure 1.</p>
      <sec id="sec-3-1">
        <title>3.1. Preprocessing</title>
        <p>
          It consisted of the following steps:
1. Replacing emojis and emoticons by their corresponding meanings [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]
2. Removing mentions
3. Removing URLs
4. Contracting whitespace
5. Extracting words from hashtags [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]
6. Normalizing numeronyms [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. RoBERTa Model</title>
        <p>RoBERTa is equipped with the BERT’s language masking method, i.e. the system intentionally
learns to predict sections of text which are hidden. Implementation of RoBERTa was done
in PyTorch. This allows modification of the key hyperparameters in BERT, which include
training with much larger mini-batches and learning rates and eliminating BERT’s objective
of next-sentence pre-training. This leads the path in the improvement of the masked language
modeling objective for RoBERTa compared with BERT and also leads to better downstream task
performance.</p>
        <p>For the sentiment analysis task from the Huggingface team transformers library, the pre-trained
RoBERTa model has been accessed. XLM RoBERTa base model has been used for the task.
Since it has been pre-trained on 100 different languages, the same model could be used for all
three languages (Hindi, English, German) datasets. The RoBERTa base uses the BERT-base
architecture hence it has 12-layer, 768-hidden, 12-heads, 125M parameters. The pre-trained
RoBERTaTokenizer for the RoBERTa large model has been used to get the token representations.
The learning rate of 1 − 5 has been selected and the model is trained for 10 epochs. The batch
size has been set to be 32. For the training procedure, a Dropout Layer for some regularization
and a fully-connected layer for the output is used in the model. The Dropout Layer reduces
overfitting in the model by preventing complex co-adaptations on training data.</p>
      </sec>
      <sec id="sec-3-3">
        <title>3.3. Random Forest Model</title>
        <p>
          Different textual features are extracted from each of the text presents in the HOF and those
features are fed into a Random Forest classifier. The textual extracted features added to the model
for classification are:
1. The vector representations were obtained using Word2Vec.
2. The TF-IDF (Term Frequency-Inverse Document Frequency) [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] for the words that
frequently occur in the text are also added to the feature list. The TF computes the number of
times a word recurs in the dataset, and IDF computes the relative importance of the word
which depends on how many times the word can be found, and is added as features to filter
and reduce the size of the final output [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
3. Normalized counts of words with positive sentiment, negative sentiment, and neutral
sentiment in the corresponding language by dividing with a word count of the corresponding
sentence [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ].
4. Normalized Frequency of auxiliary verbs by dividing by word count of the sentence.
5. Subjectivity score of the text (calculated using predefined libraries) [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ].
        </p>
        <p>The features extracted through the various above mentioned processes are selected by using
the feature importance rankings for each feature. The features having a higher feature importance
ranking were added to train the Random Forest model. The predictions given by the model for the
test dataset were checked if they match with the HOF predictions given by the RoBERTa model.
All the predictions which align with the HOF predictions are given by the RoBERTa model were
kept as final outputs.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Results</title>
      <p>Our model secured 8ℎ and 23 positions in English Sub-task A and B respectively. For German
Sub-tasks A and B, our model secured 20ℎ and 14ℎ positions respectively and for Hindi Sub-task
A and B, our model secured 20ℎ and 16ℎ positions respectively. The performance of our model
in terms of Macro F1-score is shown in Table 3.</p>
      <sec id="sec-4-1">
        <title>Sub-task</title>
        <p>A
B</p>
      </sec>
      <sec id="sec-4-2">
        <title>English</title>
        <p>0.5028
0.1623</p>
      </sec>
      <sec id="sec-4-3">
        <title>German</title>
        <p>0.3231
0.0984</p>
      </sec>
      <sec id="sec-4-4">
        <title>Hindi</title>
        <p>0.4599
0.1600</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>We have presented the system that we have used for participating in the 2020 shared task on hate
speech and offensive content (HASOC) identification in Indo-European languages. Considering
previous approaches, our approach is a comparatively different approach in terms of architecture
as well as the methodology of feature extraction. It is a generalized and versatile framework
and has shown satisfactory performance among all participating systems during the HASOC
evaluations. In future works, we will further fine-tune the classification models to increase the
performance and we will further experiment with the model in other languages.
[13] T. Mandl, S. Modha, G. K. Shahi, A. K. Jaiswal, D. Nandini, D. Patel, P. Majumder,
J. Schäfer, Overview of the HASOC track at FIRE 2020: Hate Speech and Offensive
Content Identification in Indo-European Languages), in: Working Notes of FIRE 2020
Forum for Information Retrieval Evaluation, CEUR, 2020.
[14] T. Wolf, L. Debut, V. Sanh, J. Chaumond, C. Delangue, A. Moi, P. Cistac, T. Rault,
R. Louf, M. Funtowicz, J. Brew, Huggingface’s transformers: State-of-the-art natural
language processing, CoRR abs/1910.03771 (2019). URL: http://arxiv.org/abs/1910.03771.
arXiv:1910.03771.
[15] J. Howard, et al., fastai, https://github.com/fastai/fastai, 2018.
[16] A. Garain, A. Basu, R. Dawn, S. K. Naskar, Sentence simplification using syntactic
parse trees, in: 2019 4th International Conference on Information Systems and Computer
Networks (ISCON), 2019, pp. 672–676.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Garain</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Basu</surname>
          </string-name>
          , The titans at semeval
          <article-title>-2019 task 5: Detection of hate speech against immigrants and women in twitter</article-title>
          ,
          <source>in: Proceedings of the 13th International Workshop on Semantic Evaluation</source>
          ,
          <year>2019</year>
          , pp.
          <fpage>494</fpage>
          -
          <lpage>497</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Garain</surname>
          </string-name>
          ,
          <article-title>Humor analysis based on human annotation (haha)-2019: Humor analysis at tweet level using deep learning (</article-title>
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>A.</given-names>
            <surname>Garain</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Basu</surname>
          </string-name>
          , The titans at semeval
          <article-title>-2019 task 6: Offensive language identification, categorization and target identification</article-title>
          ,
          <source>in: Proceedings of the 13th International Workshop on Semantic Evaluation</source>
          ,
          <year>2019</year>
          , pp.
          <fpage>759</fpage>
          -
          <lpage>762</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>A.</given-names>
            <surname>Garain</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. K.</given-names>
            <surname>Mahata</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Dutta</surname>
          </string-name>
          ,
          <article-title>Normalization of numeronyms using nlp techniques</article-title>
          ,
          <source>in: 2020 IEEE Calcutta Conference (CALCON)</source>
          , IEEE,
          <year>2020</year>
          , pp.
          <fpage>7</fpage>
          -
          <lpage>9</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>J.</given-names>
            <surname>Ramos</surname>
          </string-name>
          , et al.,
          <article-title>Using tf-idf to determine word relevance in document queries</article-title>
          ,
          <source>in: Proceedings of the first instructional conference on machine learning</source>
          , volume
          <volume>242</volume>
          ,
          <string-name>
            <surname>New</surname>
            <given-names>Jersey</given-names>
          </string-name>
          , USA,
          <year>2003</year>
          , pp.
          <fpage>133</fpage>
          -
          <lpage>142</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>B.</given-names>
            <surname>Ray</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Garain</surname>
          </string-name>
          ,
          <article-title>Factuality classification using bert embeddings and support vector machines (</article-title>
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A.</given-names>
            <surname>Garain</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. K.</given-names>
            <surname>Mahata</surname>
          </string-name>
          ,
          <article-title>Sentiment analysis at sepln (tass)-2019: Sentiment analysis at tweet level using deep learning (</article-title>
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>A.</given-names>
            <surname>Garain</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. K.</given-names>
            <surname>Mahata</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Dutta</surname>
          </string-name>
          ,
          <article-title>Normalization of numeronyms using nlp techniques</article-title>
          ,
          <source>in: 2020 IEEE Calcutta Conference (CALCON)</source>
          ,
          <year>2020</year>
          , pp.
          <fpage>7</fpage>
          -
          <lpage>9</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ott</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Goyal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Du</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Joshi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Levy</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Lewis</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>Roberta: A robustly optimized bert pretraining approach</article-title>
          , arXiv (
          <year>2019</year>
          ) arXiv-
          <fpage>1907</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>A.</given-names>
            <surname>Liaw</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Wiener</surname>
          </string-name>
          , et al.,
          <article-title>Classification and regression by randomforest</article-title>
          ,
          <source>R news 2</source>
          (
          <year>2002</year>
          )
          <fpage>18</fpage>
          -
          <lpage>22</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <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>P.</given-names>
            <surname>Majumder</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Patel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dave</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Mandlia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Patel</surname>
          </string-name>
          ,
          <article-title>Overview of the hasoc track at fire 2019: Hate speech and offensive content identification in indo-european languages</article-title>
          ,
          <source>in: Proceedings of the 11th Forum for Information Retrieval Evaluation</source>
          , FIRE '19,
          <string-name>
            <surname>Association</surname>
          </string-name>
          for Computing Machinery, New York, NY, USA,
          <year>2019</year>
          , p.
          <fpage>14</fpage>
          -
          <lpage>17</lpage>
          . URL: https://doi.org/10.1145/3368567.3368584. doi:
          <volume>10</volume>
          .1145/3368567.3368584.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <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>
          , arXiv preprint arXiv:
          <year>1810</year>
          .
          <volume>04805</volume>
          (
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>