Classification of comments on social media based on long short-term memory
Abstract
Social media has assumed a pivotal role in contemporary society, significantly enhancing the convenience of daily lives. Nonetheless, the prevalence of toxic comments on social media platforms has led to varying degrees of harm for individuals. The conventional practice of manually categorizing and blocking such toxic comments has proven to be highly inefficient. To address this issue, this study employs artificial intelligence natural language processing technology to classify social media comments, offering a more effective solution. In the past few years, many algorithms for handling text classification tasks have been introduced and applied in various scenarios. In this work, the author used an LSTM model that can effectively handle long sequence dependency problems to implement text classification. This study achieved an accuracy of 99.4% after training on the Kaggle toxic comments datasets. During the training process, the training accuracy is greater than the validation accuracy while the validation loss is lower than the training loss. After training, the trained model can accurately predict an input sentence and the results are within the expected range.
References
- Spiros V et al 2018 Convolutional Neural Networks for Toxic Comment Classification. In Proceedings of the 10th Hellenic Conference on Artificial Intelligence (SETN '18) Association for Computing Machinery New York NY USA Article 35 1–6
- Wikipedia: No personal attacks", Wikipedia, [online] Available: https://en.wikipedia.org/wiki/Wikipedia:No_personal_attacks.
- Li Q Peng H Li J et al. 2020 A survey on text classification: From shallow to deep learning arXiv preprint arXiv:2008.00364
- Myagmarsuren O et al 2023 Performance analysis of a novel hybrid deep learning approach in classification of quality-related English text
- Aggarwal C C Zhai C X 2012 A survey of text classification algorithms Mining text data 163-222
- Kowsari K Jafari Meimandi K Heidarysafa M et al. 2019 Text classification algorithms: A survey Information 10(4): 150
- Vaswani A Shazeer N Parmar N et al. 2017 Attention is all you need Advances in neural information processing systems 30
- Devlin J Chang M W Lee K et al. 2018 Bert: Pre-training of deep bidirectional transformers for language understanding arXiv preprint arXiv:1810.04805
- Huang Z Xu W Yu K 2015 Bidirectional LSTM-CRF models for sequence tagging arXiv preprint arXiv:1508.01991
- Fjellström C 2022 Long short-term memory neural network for financial time series 2022 IEEE International Conference on Big Data (Big Data) IEEE 3496-3504.
- Staudemeyer R C Morris E R 2019 Understanding LSTM--a tutorial into long short-term memory recurrent neural networks arXiv preprint arXiv:1909.09586
- Sherstinsky A 2020 Fundamentals of recurrent neural network (RNN) and long short-term memory (LSTM) network Physica D: Nonlinear Phenomena 404: 132306.
- Qiu Y et al 2020 Improved denoising autoencoder for maritime image denoising and semantic segmentation of USV China Communications 17(3) 46-57.
- Mehta S 2019 CNN based traffic sign classification using Adam optimizer. In 2019 international conference on intelligent computing and control systems (ICCS) pp. 1293-1298 IEEE.