Badjatiya 2017
Badjatiya 2017
759
Table 1: Comparison of Various Methods (Embedding Size=200 for Table 2: Embeddings learned using DNNs clearly show the “racist”
GloVe as well as for Random Embedding) or “sexist” bias for various words.
Method Prec Recall F1 Target Similar words using GloVe Similar words using task-
Char n-gram+Logistic Regression [6] 0.729 0.778 0.753 Word specific embeddings learned
TF-IDF+Balanced SVM 0.816 0.816 0.816 using DNNs
Part A: TF-IDF+GBDT 0.819 0.807 0.813
Baselines BoWV+Balanced SVM pakistan karachi, pakistani, lahore, mohammed, murderer, pe-
0.791 0.788 0.789 india, taliban, punjab, is- dophile, religion, terrorism,
BoWV+GBDT 0.800 0.802 0.801 lamabad islamic, muslim
CNN+Random Embedding 0.813 0.816 0.814 female male, woman, females, sexist, feminists, feminism,
CNN+GloVe 0.839 0.840 0.839 women, girl, other, artist, bitch, feminist, blonde,
Part B:
FastText+Random Embedding 0.824 0.827 0.825 girls, only, person bitches, dumb, equality,
DNNs
FastText+GloVe 0.828 0.831 0.829 models, cunt
Only
LSTM+Random Embedding 0.805 0.804 0.804 muslims christians, muslim, hindus, islam, prophet, quran,
LSTM+GLoVe 0.807 0.809 0.808 jews, terrorists, islam, slave, jews, slavery, pe-
CNN+GloVe+GBDT 0.864 0.864 0.864 sikhs, extremists, non- dophile, terrorist, terror-
Part C: CNN+Random Embedding+GBDT 0.864 0.864 0.864
DNNs + FastText+GloVe+GBDT muslims, buddhists ism, hamas, murder
0.853 0.854 0.853
GBDT FastText+Random Embedding+GBDT
Classi- LSTM+GloVe+GBDT
0.886 0.887 0.886 tiple classifiers but report results mostly for GBDTs only,
0.849 0.848 0.848 due to lack of space.
fier LSTM+Random Embedding+GBDT 0.930 0.930 0.930
As the table shows, our proposed methods in part B are
(3) FastText: FastText [2] represents a document by aver- significantly better than the baseline methods in part A.
age of word vectors similar to the BoWV model, but allows Among the baseline methods, the word TF-IDF method is
update of word vectors through Back-propagation during better than the character n-gram method. Among part B
training as opposed to the static word representation in the methods, CNN performed better than LSTM which was bet-
BoWV model, allowing the model to fine-tune the word rep- ter than FastText. Surprisingly, initialization with random
resentations according to the task. embeddings is slightly better than initialization with GloVe
All of these networks are trained (fine-tuned) using labeled embeddings when used along with GBDT. Finally, part C
data with back-propagation. Once the network is learned, methods are better than part B methods. The best method
a new tweet is tested against the network which classifies is “LSTM + Random Embedding + GBDT” where tweet
it as racist, sexist or neither. Besides learning the network embeddings were initialized to random vectors, LSTM was
weights, these methods also learn task-specific word embed- trained using back-propagation, and then learned embed-
dings tuned towards the hate speech labels. Therefore, for dings were used to train a GBDT classifier. Combinations of
each of the networks, we also experiment by using these em- CNN, LSTM, FastText embeddings as features for GBDTs
beddings as features and various other classifiers like SVMs did not lead to better results. Also note that the standard
and GBDTs as the learning method. deviation for all these methods varies from 0.01 to 0.025.
To verify the task-specific nature of the embeddings, we
3. EXPERIMENTS show top few similar words for a few chosen words in Ta-
ble 2 using the original GloVe embeddings and also embed-
3.1 Dataset and Experimental Settings dings learned using DNNs. The similar words obtained us-
ing deep neural network learned embeddings clearly show
We experimented with a dataset of 16K annotated tweets the “hatred” towards the target words, which is in general
made available by the authors of [6]. Of the 16K tweets, not visible at all in similar words obtained using GloVe.
3383 are labeled as sexist, 1972 as racist, and the remaining
are marked as neither sexist nor racist. For the embedding
based methods, we used the GloVe [5] pre-trained word em- 4. CONCLUSIONS
beddings. GloVe embeddings2 have been trained on a large In this paper, we investigated the application of deep neu-
tweet corpus (2B tweets, 27B tokens, 1.2M vocab, uncased). ral network architectures for the task of hate speech detec-
We experimented with multiple word embedding sizes for tion. We found them to significantly outperform the exist-
our task. We observed similar results with different sizes, ing methods. Embeddings learned from deep neural network
and hence due to lack of space we report results using embed- models when combined with gradient boosted decision trees
ding size=200. We performed 10-Fold Cross Validation and led to best accuracy values. In the future, we plan to explore
calculated weighted macro precision, recall and F1-scores. the importance of the user network features for the task.
We use ‘adam’ for CNN and LSTM, and ‘RMS-Prop’ for
FastText as our optimizer. We perform training in batches 5. REFERENCES
of size 128 for CNN & LSTM and 64 for FastText. More [1] N. Djuric, J. Zhou, R. Morris, M. Grbovic, V. Radosavljevic,
details on the experimental setup can be found from our and N. Bhamidipati. Hate Speech Detection with Comment
Embeddings. In WWW, pages 29–30, 2015.
publicly available source code3 . [2] A. Joulin, E. Grave, P. Bojanowski, and T. Mikolov. Bag of
Tricks for Efficient Text Classification. arXiv preprint
3.2 Results and Analysis arXiv:1607.01759, 2016.
[3] Y. Kim. Convolutional Neural Networks for Sentence
Table 1 shows the results of various methods on the hate Classification. In EMNLP, pages 1746–1751, 2014.
speech detection task. Part A shows results for baseline [4] C. Nobata, J. Tetreault, A. Thomas, Y. Mehdad, and Y. Chang.
methods. Parts B and C focus on the proposed methods Abusive Language Detection in Online User Content. In WWW,
where part B contains methods using neural networks only, pages 145–153, 2016.
[5] J. Pennington, R. Socher, and C. D. Manning. GloVe: Global
while part C uses average of word embeddings learned by Vectors for Word Representation. In EMNLP, volume 14, pages
DNNs as features for GBDTs. We experimented with mul- 1532–43, 2014.
[6] Z. Waseem and D. Hovy. Hateful Symbols or Hateful People?
2
http://nlp.stanford.edu/projects/glove/ Predictive Features for Hate Speech Detection on Twitter. In
3 NAACL-HLT, pages 88–93, 2016.
https://github.com/pinkeshbadjatiya/twitter-hatespeech
760