/HateAndAggressionDetection

For, hate and aggression detection

Primary LanguageJupyter Notebook

A Comprehensive Study of Hate and Aggression Detection on Social Media

With the rise of social media's availability, people have been using such platforms to express themselves. While, these allow people to communicate throughout the world without much censoring, hate and aggression has also been increasing. Since, they are fine-grained sentiments, thus they end up passing the elementary sentiment detection algorithms easily, making social media a toxic place. Due to the social media guidelines and policies, several of such comments and/or posts are often taken down, thus making the collection of data even scarce. This research involves a comprehensive of study of low resource algorithms such as regression, to high resource algorithms as BERT and other Deep learning approaches such as force-feed, label smoothing, transfer learning, alongside with a newer approach of introducing PonderNet, which adapts its computational learning in a probabilistic approach depending upon the data provided, which makes its result more humane.

Disclaimer –

The article contains material that many will find offensive or hateful; however this cannot be avoided owing to the nature of the work.

Keywords –

Hate speech detection · Social media texts · Machine learning · Text classification

Datasets used -

Due to online platform guidelines, comments and/or posts which have crossed the community guidelines often get taken down which makes the collection of such data even scarce. For the purpose of this study, 2 benchmark datasets have been considered i.e.

  1. HateXplain dataset –

  2. SemEval 2019 Task 5 dataset-

This dataset contains 2 sets of such offensive tweets in English and Spanish language. The text is binary categorized for 3 different kinds i.e. hateful, targeted and aggressive, with 0 representing not and 1 accounting for the positive. This dataset has 4469 tweets for training in spanish and 2805 tweets for training in english language.

  1. TRAC dataset-

This dataset contains comments from facebook in english and hindi languages for aggression detection and has 3 different levels of aggression i.e. NAG, CAG and OAG. This dataset contains 12000 elements for english language and 12000 elements for training in hindi language.

Models used -

The following models of classification shall be used for the study's purposes :

  • Low Resource Models
  1. Logistic Regression
  2. K-NN
  3. SVM
  4. Random Forests
  • Boosted Algorithms
  1. ADABOOST
  • Deep learning algorithms-
  1. CNN-GRU
  2. BERT
  3. mBERT
  • Transfer Learning model
  1. MUSE + CNN_GRU
  2. Translation +BERT
  3. LASER + LR
  • PonderNet

Outputs Received :

For Low Resource Models :

For agr_en_train model:

Technique type Model Name Precision Recall Support F1-Score Accuracy
--- Random Forests 0.51 0.52 3000 0.51 0.52
Low Resource KNN 0.49 0.48 3000 0.46 0.48
Models _ SVM _ _ 0.54 _ _ 0.53 _ _ 3000 _ _ 0.50 _ _ 0.53 _
--- _ Multinomial Naive Bayes _ _ 0.54 _ _ 0.53 _ _ 3000 _ _ 0.50 _ _ 0.53 _
Transfer Learning Machine Translation - Seq2Seq 0.41 0.41 2400 0.40 ---