<!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>Machine Learning based hate speech identification for English and Indo-Aryan languages</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Anirudh Anand</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jeet Golecha</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>B.Bharathi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bhuvana Jayaraman</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mirnalinee T.T</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of CSE Sri Sivasubramaniya Nadar College of Engineering</institution>
          ,
          <addr-line>Chennai, Tamil Nadu</addr-line>
          ,
          <country country="IN">India</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Social media platforms pave way for the public to express their opinions. These opinions are mostly on the events and happenings across the world. These comments are most often unbiased and cross the individual boundaries that cause hurt to the people involved. Some comments are intentionally delivered through these platforms with the purpose of ofending the party concerned. An automatic technique is needed to identify ofensive comments to prevent unwanted consequences. Our work is a part of Hate Speech and Ofensive Content Identification in English and Indo-Aryan Languages, where the ofensive public opinions on social media platforms are to identified. We have devised a system that uses both machine learning and deep learning techniques to detect the ofensive comments. Random Forest has obtained 78% macro F1 score, in Hindi Recurrent Neural Network performed well with 73% and Support vector machine with 75% macro F1 score.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Indo-Aryan Languages</kwd>
        <kwd>Ofensive comments</kwd>
        <kwd>Text classification</kwd>
        <kwd>Machine learning</kwd>
        <kwd>Deep Learning</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>With the development of technologies such as Artificial Intelligence, Machine learning, email,
internet applications, came the social media and instant messaging applications. With the right
to speech, people used these platforms to convey their thoughts and opinions. Most of the
time these opinionated thoughts would cross their rightful boundaries and became ofensive.
Comments made on the social media platform get viral and publicised to get more attention
from the public which are often hurtful, and derogatory. The hateful messages are mostly on the
premise of religion, one’s identity, gender, race, nationality, inclination towards one’s ideology
and so on. Such comments may incite violence and imbalance to the peacefulness of the society
in its worst case. For an individual, the insulting comments may lead to anxiety, depression and
mental instabilities.</p>
      <p>The hateful expressions can be handled in a few ways manually namely, calling out the
inaccuracies in the comments or messages, tackling them politely, challenging them back and
refuting them to show the truthful side or facts. Most of the time, handling social media
harassment’s went out of hand and demands the need for automatic handling of such messages.
On the other hand the issue can be taken up on a legal way and could be handled to counter the
efects caused by the hurtful messages.</p>
      <p>Necessity towards building a computational model to handle the ofensive social media
comments has been increased in recent times. Social media organizations are working towards
automatic handling of such ofensive contents in order to preserve the sanity of their platforms.
A single generalized model to identify the ofensive comments irrespective of the languages
they are based on, is the need of the day.</p>
      <p>In this paper we investigated the performance of diferent machine learning and deep learning
techniques in classifying the social media comments in English and Indo-Aryan languages into
hate and ofensive. This work is a part of Hate Speech and Ofensive Content Identification
in English and Indo-Aryan Languages (HASOC, 2021) under Forum for Information Retrieval
Evaluation (FIRE, 2021). The section 2 provides the survey of existing work, section 3 discusses
about the proposed system, experimental results and related discussion are given in section 4
and conclusion with direction for future enhancement in section 5.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Literature Survey</title>
      <p>
        Machine learning and deep learning algorithms [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] have been widely used in identifying the
ofensive comments. This section reports similar such works that have been carried out recently
in Indo-Aryan and English languages. For text classification machine learning approaches
have performed well in literature so far [
        <xref ref-type="bibr" rid="ref2 ref3 ref4">2, 3, 4</xref>
        ]. Advancements in technologies brought the
computationally intensive deep learning algorithms to reality. In text classification [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]
TF-IDF based vectorization, and transfer learning-based multilingual BERT technique have
given a noticeable performance.
      </p>
      <p>
        MOLD, the Marathi Ofensive Language Dataset has been created to classify the ofensive
comments in Marathi language [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] having 2500 tweets that are annotated. Authors observed the
predictions of closely related languages like Bengali and Hindi to classify the ofensive tweets in
Marathi. This corpus has three levels of information namely, whether the tweets are ofensive
or not, categorizes as threat, profanity, insult and to whom it is targeted as individual or group.
Several machine learning and deep learning classifiers are applied to identify the tweets of this
corpus namely SVM, Logistic Regression, Naive Bayes, CNN, RNN, etc.
      </p>
      <p>
        A corpus is constructed with linguistic taboos and euphemisms in Nepali language [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. These
are based on racial discrimination, religion and disability with 1000 diferent taboos. This corpus
can be used to identify any hurtful or derogatory comments.
      </p>
      <p>
        An USAD (Urdu Slang and Abusive words Detection) automatic lexicon-based system was
designed [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] to detect the hurtful and ofensive slang words in Perso-Arabic-scripted Urdu
Tweets. USAD constitute two phases with lexicon building and testing. The model attained a
precision of 72.6% tweets were identified as abusive.
      </p>
      <p>
        Indo-Aryan and Dravidian languages are investigated [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], using multilingual transformers to
identify ofensive comments. The work has used cross-lingual word embeddings while designing
the model and compared with single multilingual model. Authors have studied the language
similarity and typology impacts along with zero shot and few-shot learning techniques. XLM-R
with a softmax added as a final layer used for text classification.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Methodology Adopted</title>
      <p>The proposed system of detecting ofensive content from the HASOC2021 Subtask 1 data is
described in the following sections. The steps involved in the proposed system are as follows:
1. Data preprocessing
2. Feature extraction
3. Model training
4. Testing</p>
      <sec id="sec-3-1">
        <title>3.1. Pre-processing</title>
        <p>Pre-processing is done to prepare the input data for further processing namely by removing the
words that do not give meaning of the tweet, removing the special characters and getting the
root word from the derived word, etc. The following preprocessing steps are carried out for the
training data of all the three languages:
1. Stop word removal
2. Remove numbers
3. Remove special characters
4. Lemmatization through wordnet lemmatizer
5. Stemming through port stemmer</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Feature extraction</title>
        <p>Term Frequency Inverse Document Frequency vectors are extracted from the text. The char
TF-IDF is calculated as explained in equation 1.</p>
        <p>For each char  in a document  from the document set , TF-IDF is calculated as:
N is the total number of documents.
where
  (, , ) =  (, ). (, )</p>
        <p>(, ) = (1 +  (, ))
 (, ) = (</p>
        <p>( :  )
)
(1)
(2)
(3)</p>
      </sec>
      <sec id="sec-3-3">
        <title>3.3. Model training</title>
        <p>The extracted features (TF-IDF) are used for training the machine learning algorithms such
as Random forest, Linear regression, Support vector machine and Recurrent neural network.
For Recurrent neural network, an embedding layer is included to get the embeddings for the
text that uses default embedding in Keras. The model parameters used for these algorithms are
given in Section 4. From the given dataset, 80% of the data used for training and remaining
20% of the data used for model tuning. The machine learning model implementations and the
metrics of comparison is used from Scikit-learn 1.</p>
      </sec>
      <sec id="sec-3-4">
        <title>3.4. Model Testing</title>
        <p>The four trained models using Random forest, Linear regression, SVM and LSTM are tested with
the test data for evaluating their performance of classification. The metrics observed during the
testing are discussed in the following section.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Experimental results and Discussion</title>
      <sec id="sec-4-1">
        <title>4.1. Dataset Description</title>
        <p>
          In this proposed work, Subtask 1A data of HASOC 2021 is used. The data sets are given in three
languages namely English, Hindi and Marathi. The datasets are sampled from Twitter. More
details about the dataset are given in [
          <xref ref-type="bibr" rid="ref11 ref12">11, 12</xref>
          ]. Number of samples available for each class the
dataset are described in Table 1.
        </p>
        <p>Sub-task A focus on Hate speech and Ofensive language identification ofered for English,
Hindi, and Marathi. The objective of this task is to classify the tweets into two classes, namely:
Hate and Ofensive (HOF) and Non- Hate, and ofensive (NOT). In the proposed approach, the
preprocessed text is trained using the machine learning algorithms such as Random forest, Linear
regression, Support vector machine, and Recurrent neural network for all three languages. For a
Random forest classifier, a number of jobs are assigned as 2 and the random state is initialized as
0. For the Support vector machine, the linear kernel is used. For logistic regression classifier, the
random state is initialized as 0. For Recurrent neural network, the embedding layer is included
to get the embeddings of preprocessed text. The number of LSTM units is 40, adam optimizer is
used.</p>
        <p>The cross-validation accuracy for English is given in Table 2. From Table 2, it has been noted
that Random forest classifier produces the F1-score of 0.68 and accuracy of 80.2%.</p>
        <p>The cross-validation accuracy for Hindi is given in Table 3. From Table 3, it has been noted
that Random forest classifier produces the F1-score of 0.86 and accuracy of 79.2%.</p>
        <p>The cross-validation accuracy for Marathi is given in Table 4.</p>
        <p>From Table 4, it has been inferred that the performance of support vector machine is better
than other models.</p>
        <p>The performance of the proposed system using test data is shown in Table 5.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>The need for automatic identification of ofensive comments across social media platforms
motivated us to devise a system that uses both machine learning and deep learning techniques.
This work has been submitted as a part of Hate Speech and Ofensive Content Identification
in English and Indo-Aryan Languages (HASOC, 2021). One generalized approach cannot be
designed to perform this classification in English and Indo-Aryan Languages. In the proposed
automatic system for ofensive comment identification, Random Forest, SVM and RNN have
outperformed with 78%, 75% and 73% of macro F1 score in Marathi, English and Hindli
respectively. This can be further explored using multilingual word embeddings using transfer learning
deep neural networks and by exploring the various parameters involved in those networks.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>L.</given-names>
            <surname>Deng</surname>
          </string-name>
          , Y. Liu, Deep learning in
          <source>natural language processing</source>
          , Springer,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>B.</given-names>
            <surname>Bharathi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Bhuvana</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N. N. A.</given-names>
            <surname>Balaji</surname>
          </string-name>
          ,
          <article-title>Ssncse-nlp@ evalita2020: Textual and contextual stance detection from tweets using machine learning approach, EVALITA Evaluation of NLP and Speech Tools for Italian-December 17th,</article-title>
          <year>2020</year>
          (
          <year>2020</year>
          )
          <fpage>224</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>B.</given-names>
            <surname>Bharathi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Anirudh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Bhuvana</surname>
          </string-name>
          ,
          <article-title>Bharathi ssn@ inli-fire-2017: Svm based approach for indian native language identification</article-title>
          .,
          <source>in: FIRE (Working Notes)</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>110</fpage>
          -
          <lpage>112</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>H.</given-names>
            <surname>Sandaruwan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Lorensuhewa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Kalyani</surname>
          </string-name>
          ,
          <article-title>Identification of abusive sinhala comments in social media using text mining and machine learning techniques</article-title>
          ,
          <source>International Journal on Advances in ICT for Emerging Regions</source>
          <volume>13</volume>
          (
          <year>2020</year>
          )
          <article-title>1</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>N. N. A.</given-names>
            <surname>Balaji</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Bharathi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Bhuvana</surname>
          </string-name>
          ,
          <article-title>Ssncse_nlp@ dravidian-codemix-fire2020: Sentiment analysis for dravidian languages in code-mixed text</article-title>
          .,
          <source>in: FIRE (Working Notes)</source>
          ,
          <year>2020</year>
          , pp.
          <fpage>554</fpage>
          -
          <lpage>559</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>K.</given-names>
            <surname>Yasaswini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Puranik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hande</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Priyadharshini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Thavareesan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B. R.</given-names>
            <surname>Chakravarthi</surname>
          </string-name>
          , Iiitt@
          <fpage>dravidianlangtech</fpage>
          -eacl2021:
          <article-title>Transfer learning for ofensive language detection in dravidian languages</article-title>
          ,
          <source>in: Proceedings of the First Workshop on Speech and Language Technologies for Dravidian Languages</source>
          ,
          <year>2021</year>
          , pp.
          <fpage>187</fpage>
          -
          <lpage>194</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>S.</given-names>
            <surname>Gaikwad</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Ranasinghe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Zampieri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C. M.</given-names>
            <surname>Homan</surname>
          </string-name>
          ,
          <article-title>Cross-lingual ofensive language identification for low resource languages: The case of marathi</article-title>
          ,
          <source>Proceedings of RANLP</source>
          (
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>N. B.</given-names>
            <surname>Niraula</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Dulal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Koirala</surname>
          </string-name>
          ,
          <article-title>Linguistic taboos and euphemisms in nepali</article-title>
          , arXiv preprint arXiv:
          <year>2007</year>
          .
          <volume>13798</volume>
          (
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>N. U.</given-names>
            <surname>Haq</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ullah</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Khan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ahmad</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Almogren</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Hayat</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Shafi</surname>
          </string-name>
          ,
          <article-title>Usad: an intelligent system for slang and abusive text detection in perso-arabic-scripted urdu</article-title>
          ,
          <year>Complexity 2020</year>
          (
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>T.</given-names>
            <surname>Ranasinghe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Zampieri</surname>
          </string-name>
          ,
          <article-title>An evaluation of multilingual ofensive language identification methods for the languages of india</article-title>
          ,
          <source>Information</source>
          <volume>12</volume>
          (
          <year>2021</year>
          )
          <fpage>306</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>S.</given-names>
            <surname>Modha</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Mandl</surname>
          </string-name>
          , G. Shahi,
          <string-name>
            <given-names>H.</given-names>
            <surname>Madhu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Satapara</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Ranasinghe</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>Zampieri, Overview of the hasoc subtrack at fire 2021: Hate speech and ofensive content identification in english and indo-aryan languages and conversational hate speech</article-title>
          ,
          <source>in: FIRE</source>
          <year>2021</year>
          :
          <article-title>Forum for Information Retrieval Evaluation, Virtual Event</article-title>
          ,
          <fpage>13th</fpage>
          -17th
          <source>December</source>
          <year>2021</year>
          ,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>T.</given-names>
            <surname>Mandl</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Modha</surname>
          </string-name>
          , G. Shahi,
          <string-name>
            <given-names>H.</given-names>
            <surname>Madhu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Satapara</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>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Ranasinghe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Zampieri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Nandini</surname>
          </string-name>
          , et al.,
          <source>Overview of the hasoc subtrack at fire</source>
          <year>2021</year>
          :
          <article-title>Hate speech and ofensive content identification in english and indo-aryan languages</article-title>
          ,
          <source>Working Notes of FIRE</source>
          (
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>