A Novel Stacked Ensemble for Hate Speech Recognition
Abstract
:1. Introduction
- Develop a novel stacked ensemble model for binary detection of hate speech on social media platforms;
- Use of the four publicly available hate speech datasets with varying sizes to allow comparison of future work;
- Compare the proposed model’s result against the standard stacking, single classifiers, majority voting, and state-of-the-art results;
- Improve the performance of the standard stacking approach.
2. Materials and Methods
2.1. Proposed Approach
2.1.1. Preprocessing
- Hashtag symbols ‘#’ are removed;
- Mentions ‘@’ are removed;
- URLs are removed;
- All characters are changed to lowercase;
- All words are stemmed;
- Non-words or single characters are removed.
2.1.2. Feature Extraction
- Word embeddings: we employed word2vec to represent each word by a vector of size 200, with the skip-gram technique, which predicts the context from the given word;
- Sentence embeddings: we employed USE to encode tweets into vectors [22]. The encoder takes preprocessed text as input and outputs the sentence embeddings as vectors with 512 dimensions.
2.1.3. Base-Level Classifiers
2.1.4. Meta-Level Classifier
2.1.5. Evaluation Metrics
3. Experimental Setup and Results
3.1. Datasets
3.1.1. HatEval Dataset
3.1.2. Davidson Dataset
3.1.3. COVID-HATE Dataset
3.1.4. ZeerakW Dataset
3.2. Results from Proposed Stacking Experiment
3.3. Results from Single Classifier Experiment
3.4. Results from Majority Voting Experiment
3.5. Results from Standard Stacking Experiment
4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Sachdeva, J.; Chaudhary, K.K.; Madaan, H.; Meel, P. Text based hatespeech analysis. In Proceedings of the International Conference Artifitial Intellegent Smart System (ICAIS), Coimbatore, India, 25–27 March 2021; pp. 661–668. [Google Scholar]
- Ibrohim, M.O.; Budi, I. Multi-label hate speech and abusive language detection in Indonesian Twitter. In Proceedings of the 3rd Workshop Abusive Language Online, Florence, Italy, 3 August 2019; pp. 46–57. [Google Scholar]
- Graff, M.; Miranda-Jiménez, S.; Tellez, E.; Ochoa, D.A. INGEOTEC at SemEval-2019 task 5 and task 6: A genetic programming approach for text classification. In Proceedings of the 13th International Workshop Semantic Evaluation, Minneapolis, MN, USA, 6–7 June 2019; pp. 639–644. [Google Scholar]
- Roy, P.K.; Tripathy, A.K.; Das, T.K.; Gao, X.Z. A Framework for Hate Speech Detection Using Deep Convolutional Neural Network. IEEE Access 2020, 8, 204951–204962. [Google Scholar]
- Mohapatra, S.K.; Prasad, S.; Bebarta, D.K.; Das, T.K.; Srinivasan, K.; Hu, Y.-C. Automatic Hate Speech Detection in English-Odia Code Mixed Social Media Data Using Machine Learning Techniques. Appl. Sci. 2021, 11, 8575. [Google Scholar] [CrossRef]
- Waseem, Z.; Hovy, D. Hateful symbols or hateful people? Predictive features for hate speech detection on twitter. In Proceedings of the NAACL Student Research Workshop, San Diego, CA, USA, 13–15 June 2016; pp. 88–93. [Google Scholar] [CrossRef]
- Davidson, T.; Warmsley, D.; Macy, M.; Weber, I. Automated hate speech detection and the problem of offensive language. In Proceedings of the International AAAI Conference on Web and Social Media, Montreal, QC, Canada, 15–18 May 2017; Available online: https://ojs.aaai.org/index.php/ICWSM/article/view/14955 (accessed on 29 June 2021).
- Ibrohim, M.O.; Budi, I. A dataset and preliminaries study for abusive language detection in Indonesian social media. Procedia Comput. Sci. 2018, 135, 222–229. [Google Scholar] [CrossRef]
- Indurthi, V.; Syed, B.; Shrivastava, M.; Chakravartula, N.; Gupta, M.; Varma, V. Fermi at semeval-2019 task 5: Using sentence embeddings to identify hate speech against immigrants and women in twitter. In Proceedings of the 13th International Workshop on Semantic Evaluation, Minneapolis, MN, USA, 6–7 June 2019; pp. 70–74. [Google Scholar]
- Wolpert, D.H. Stacked generalization. Neural Netw. 1992, 5, 241–259. [Google Scholar] [CrossRef]
- Oza, N.C.; Tumer, K. Classifier ensembles: Select real-world applications. Inform. Fusion 2008, 9, 4–20. [Google Scholar] [CrossRef]
- Kaggle. Available online: http://kaggle.com (accessed on 15 July 2021).
- Badjatiya, P.; Gupta, S.; Gupta, M.; Varma, V. Deep learning for hate speech detection in tweets. In Proceedings of the 26th International Conference on World Wide Web Companion, Perth, Australia, 3–7 April 2017; pp. 759–760. [Google Scholar] [CrossRef] [Green Version]
- Aria, N.; Vermeer, F.; Wiltvank, G.; Goot, R. Sthruggle at SemEval-2019 Task 5: An ensemble approach to hate speech detection. In Proceedings of the 13th International Workshop on Semantic Evaluation, Minneapolis, MN, USA, 6–7 June 2019; pp. 484–488. [Google Scholar]
- Kokatnoor, S.A.; Krishnan, B. Twitter hate speech detection using stacked weighted ensemble (SWE) model. In Proceedings of the 2020 Fifth International Conference on Research in Computational Intelligence and Communication Networks (ICRCICN) 2020, Bangalore, India, 26 November 2020; pp. 87–92. [Google Scholar] [CrossRef]
- Gao, L.; Huang, R. Detecting online hate speech using context aware models. arXiv 2017, arXiv:1710.07395. Available online: https://aclanthology.org/2020.lrec-1.758 (accessed on 28 June 2021).
- MacAvaney, S.; Yao, H.R.; Yang, E.; Russell, K.; Goharian, N.; Frieder, O. Hate speech detection: Challenges and solutions. PLoS ONE 2019, 14, e0221152. [Google Scholar]
- Zimmerman, S.; Kruschwitz, U.; Fox, C. Improving hate speech detection with deep learning ensembles. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation, Miyazaki, Japan, 7–12 May 2018; pp. 2546–2553. [Google Scholar]
- Zhang, Z.; Robinson, D.; Tepper, J. Detecting hate speech on twitter using a convolution-gru based deep neural network. In Proceedings of the European Semantic Web Conference, Anissaras, Crete, Greece, 3–7 June 2018; Springer: Cham, Switzerland, 2018. [Google Scholar] [CrossRef] [Green Version]
- Antonakaki, D.; Fragopoulou, P.; Ioannidis, S. A survey of Twitter research: Data model, graph structure, sentiment analysis and attacks. Expert Syst. Appl. 2021, 164, 114006. [Google Scholar] [CrossRef]
- Camacho-Collados, J.; Pilehvar, M.T. From word to sense embeddings: A survey on vector representations of meaning. J. Artif. Intell. Res. 2018, 63, 743–788. [Google Scholar] [CrossRef] [Green Version]
- Cer, D.; Yang, Y.; Kong, S.Y.; Hua, N.; Limtiaco, N.; John, R.S.; Constant, N.; Guajardo-Céspedes, M.; Yuan, S.; Tar, C.; et al. Universal sentence encoder. arXiv 2018, arXiv:1803.11175. [Google Scholar]
- Kim, Y. Convolutional neural networks for sentence classification. In Proceedings of the EMNLP, Doha, Qatar, 25–29 October 2014; pp. 1746–1751. [Google Scholar] [CrossRef] [Green Version]
- Weinberger, K.Q.; Saul, L.K. Distance metric learning for large margin nearest neighbor classification. J. Mach. Learn. Res. 2009, 10, 207–244. [Google Scholar]
- Breiman, L. Bagging predictors. Mach. Learn. 2001, 45, 123–140. [Google Scholar] [CrossRef] [Green Version]
- Agarwal, S.; Chowdary, C.R. A-stacking and A-bagging: Adaptive versions of ensemble learning algorithms for spoof fingerprint detection. Expert Syst. Appl. 2020, 146, 113160. [Google Scholar] [CrossRef]
- Van Thin, D.; Le, L.S.; Nguyen, N.L.T. Nlp@ uit: Exploring feature engineer and ensemble model for hate speech detection at vlsp 2019. Training 1991, 5, 3–51. [Google Scholar]
- Verma, G.; Chhaya, N.; Vinay, V. To target or not to target: Identification and analysis of abusive text using ensemble of classifiers. arXiv 2020, arXiv:2006.03256. [Google Scholar]
- Abuzayed, A.; Elsayed, T. Quick and simple approach for detecting hate speech in Arabic tweets. In Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools, with a Shared Task on Offensive Language Detection, Marseille, France, 11–16 May 2020. [Google Scholar]
- Salminen, J.; Hopf, M.; Chowdhury, S.A.; Jung, S.G.; Almerekhi, H.; Jansen, B.J. Developing an online hate classifier for multiple social media platforms. Human-Cent. Comput. Inform. Sci. 2020, 10, 1–34. [Google Scholar] [CrossRef]
- Chawla, N.V.; Bowyer, K.W.; Hall, L.O.; Kegelmeyer, W.P. SMOTE: Synthetic minority over-sampling technique. J. Artif. Intell. Res. 2002, 16, 321–357. [Google Scholar] [CrossRef]
- Li, Y.; Nie, X.; Huang, R. Web spam classification method based on deep belief networks. Expert Syst. Appl. 2018, 96, 261–270. [Google Scholar] [CrossRef]
- Nobata, C.; Tetreault, J.; Thomas, A.; Mehdad, Y.; Chang, Y. Abusive language detection in online user content. In Proceedings of the 25th International Conference on World Wide Web, Montréal, QC, Canada, 11–15 April 2016; International World Wide Web Conferences Steering Committee, Republic and Canton of Geneva: Geneva, Switzerland, 2016; pp. 145–153. [Google Scholar] [CrossRef] [Green Version]
- de Gibert, O.; Perez, N.; García-Pablos, A.; Cuadros, M. Hate speech dataset from a white supremacy forum. In Proceedings of the 2nd Workshop on Abusive Language Online, Brussels, Belgium, 31 October 2018. [Google Scholar]
- Fortuna, P.; Nunes, S. Stop PropagHate at SemEval-2019 Tasks 5 and 6: Are abusive language classification results reproducible? In Proceedings of the 13th International Workshop on Semantic Evaluation, Minneapolis, MN, USA, 6–7 June 2019; pp. 745–752. [Google Scholar]
- Lorena, A.C.; Jacintho, L.F.; Siqueira, M.F.; De Giovanni, R.; Lohmann, L.G.; De Carvalho, A.C.; Yamamoto, M. Comparing machine learning classifiers in potential distribution modelling. Expert Syst. Appl. 2011, 38, 5268–5275. [Google Scholar] [CrossRef]
- Basile, V.; Bosco, C.; Fersini, E.; Debora, N.; Patti, V.; Pardo, F.M.R.; Rosso, P.; Sanguinetti, M. Semeval-2019 task 5: Multilingual detection of hate speech against immigrants and women in Twitter. In Proceedings of the 13th International Workshop on Semantic Evaluation, Minneapolis, MN, USA, 6 June 2019; pp. 54–63. [Google Scholar]
- Goldberg, Y. A primer on neural network models for natural language processing. J. Artif. Intell. Res. 2016, 57, 345–420. [Google Scholar]
Dataset Name | Link |
---|---|
HatEval | http://hatespeech.di.unito.it/hateval.html (accessed on 30 June 2021) |
Davidson | https://data.world/thomasrdavidson/hate-speech-and-offensive-language |
COVID-HATE | http://claws.cc.gatech.edu/covid/#dataset |
ZeerakW | https://github.com/ZeerakW/hatespeech/blob/master/NAACL_SRW_2016.csv |
Non-Hateful Tweet (0) | Hateful Tweet (1) | Total | |
---|---|---|---|
Train | 5217 (58%) | 3783 (42%) | 9000 |
Development | 573 (57%) | 427 (43%) | 1000 |
Test | 1740 (58%) | 1260 (42%) | 3000 |
Total | 7530 (58%) | 5470 (42%) | 13,000 |
Non-Hateful Tweet (0) | Hateful Tweet (1) | Total | |
---|---|---|---|
Train | 3010 (17%) | 14,833 (83%) | 17,843 |
Development | 327 (17%) | 1656 (83%) | 1983 |
Test | 826 (17%) | 4131 (83%) | 4957 |
Total | 4163 (17%) | 20,620 (83%) | 24,783 |
Non-Hateful Tweet (0) | Hateful Tweet (1) | Total | |
---|---|---|---|
Train | 965 (58%) | 704 (42) | 1669 |
Development | 106 (57%) | 80 (43%) | 186 |
Test | 249 (54%) | 215 (46%) | 464 |
Total | 1320 (57%) | 999 (43%) | 2319 |
Non-Hateful Tweet (0) | Hateful Tweet (1) | Total | |
---|---|---|---|
Train | 7935 (68%) | 3682 (32%) | 11,617 |
Development | 877 (68%) | 414 (32%) | 1291 |
Test | 2221 (69%) | 1006 (31%) | 3227 |
Total | 11,033 (68%) | 5102 (32%) | 16,135 |
Base-Level Classifier | HatEval | Davidson | COVID-HATE | ZeerakW |
---|---|---|---|---|
KNN | 0.6061 | 0.9296 | 0.6982 | 0.7480 |
LR | 0.6434 | 0.9343 | 0.7761 | 0.8406 |
SVM | 0.6180 | 0.9517 | 0.7632 | 0.8398 |
NB | 0.6845 | 0.8669 | 0.7201 | 0.7402 |
RF | 0.6443 | 0.8671 | 0.7963 | 0.6081 |
E-tree | 0.5808 | 0.9358 | 0.7745 | 0.7180 |
XGB | 0.6745 | 0.9500 | 0.7960 | 0.8253 |
Base-Classifiers Combination | HatEval | Davidson | COVID-HATE | ZeerakW |
---|---|---|---|---|
SVM, LR, XGB | 0.6551 | 0.9713 | 0.7301 | 0.7392 |
KNN, SVM, NB | 0.6405 | 0.9613 | 0.6920 | 0.7049 |
LR, NB, RF | 0.6407 | 0.9601 | 0.7136 | 0.7226 |
KNN, LR, NB | 0.6410 | 0.9710 | 0.7261 | 0.7150 |
SVM, LR, E-tree | 0.6428 | 0.9710 | 0.7255 | 0.7253 |
Base-Level Classifier | HatEval | Davidson | COVID-HATE | ZeerakW |
---|---|---|---|---|
KNN | 0.5885 | 0.9281 | 0.6580 | 0.6037 |
LR | 0.6407 | 0.9365 | 0.7146 | 0.7179 |
SVM | 0.6394 | 0.9530 | 0.6843 | 0.7030 |
NB | 0.6024 | 0.8745 | 0.6539 | 0.5508 |
RF | 0.6016 | 0.8797 | 0.6710 | 0.6274 |
E-tree | 0.6031 | 0.9397 | 0.6542 | 0.6747 |
XGB | 0.6353 | 0.9498 | 0.7246 | 0.7058 |
Base-Classifiers Combination | HatEval | Davidson | COVID-HATE | ZeerakW |
---|---|---|---|---|
SVM, LR, XGB | 0.6296 | 0.9521 | 0.7050 | 0.7221 |
KNN, SVM, NB | 0.6170 | 0.9509 | 0.7188 | 0.7005 |
LR, NB, RF | 0.6135 | 0.9309 | 0.6950 | 0.6280 |
KNN, LR, NB | 0.6167 | 0.9547 | 0.7208 | 0.6289 |
SVM, LR, E-tree | 0.6307 | 0.9552 | 0.7081 | 0.7210 |
Base-Classifiers Combination | HatEval | Davidson | COVID-HATE | ZeerakW |
---|---|---|---|---|
SVM, LR, XGB | 0.5910 | 0.9517 | 0.7036 | 0.6657 |
KNN, SVM, NB | 0.5746 | 0.9434 | 0.6623 | 0.6806 |
LR, NB, RF | 0.5804 | 0.9412 | 0.7047 | 0.6754 |
KNN, LR, NB | 0.5873 | 0.9437 | 0.7046 | 0.6815 |
SVM, LR, E-tree | 0.5943 | 0.9491 | 0.6859 | 0.6472 |
Approaches | HatEval | Davidson | COVID-HATE | ZeerakW |
---|---|---|---|---|
Proposed Stacking | 0.6551 | 0.9713 | 0.7301 | 0.7392 |
Standard Stacking | 0.5943 | 0.9517 | 0.7047 | 0.6815 |
Single classifiers | 0.6307 | 0.9530 | 0.7208 | 0.7179 |
Majority voting | 0.6407 | 0.9552 | 0.7246 | 0.7221 |
State-of-the-Art | Dataset | F1-Score | Model | Features |
---|---|---|---|---|
Indurthi et al. [9] | HatEval | 65.1% | SVM | USE |
Zhang et al. [19] | Davidson | 94.0% | CNN, GRU (Ensemble) | word2vec |
Zimmerman et al. [18] | ZeerakW | 77.8% | Neural networks (Ensemble) | word2vec |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Aljero, M.K.A.; Dimililer, N. A Novel Stacked Ensemble for Hate Speech Recognition. Appl. Sci. 2021, 11, 11684. https://doi.org/10.3390/app112411684
Aljero MKA, Dimililer N. A Novel Stacked Ensemble for Hate Speech Recognition. Applied Sciences. 2021; 11(24):11684. https://doi.org/10.3390/app112411684
Chicago/Turabian StyleAljero, Mona Khalifa A., and Nazife Dimililer. 2021. "A Novel Stacked Ensemble for Hate Speech Recognition" Applied Sciences 11, no. 24: 11684. https://doi.org/10.3390/app112411684
APA StyleAljero, M. K. A., & Dimililer, N. (2021). A Novel Stacked Ensemble for Hate Speech Recognition. Applied Sciences, 11(24), 11684. https://doi.org/10.3390/app112411684