Sentence-Level Long Short-Term Memory Framework for Real-Time Cyberbullying Prediction on Twitter Data
Abstract
Cyberbullying has become one of the most persistent risks associated with social networking platforms because abusive, discriminatory, and threatening messages can be produced and disseminated at speed, scale, and low cost. This manuscript repackages an attached project into a journal-style article and presents a sentence-level long short-term memory framework for real-time cyberbullying prediction on Twitter-derived text. The study addresses the limitations of earlier character-level or shallow machine-learning approaches by exploiting sequential language modelling for contextual discrimination across five target classes: ethnicity or race, gender or sexual, religion, other cyberbullying, and non-cyberbullying. A Kaggle dataset containing 98,213 labelled tweets was cleaned, normalized, tokenized, encoded, and used to train an embedding-based LSTM classifier with dropout regularization and softmax output. The model was implemented in Python and deployed through a Flask-based interface for interactive sentence-level prediction. Reported results show progressive improvement during training, with test accuracy increasing from 0.8034 at the first epoch to 0.9934 at the tenth epoch while validation loss decreased from 0.5169 to 0.0209. The system also produced plausible class assignments for representative bullying and non-bullying inputs. Although the study remains limited by single-platform data and the absence of external validation, it demonstrates that LSTM-based sequence modelling can provide a practical and academically credible basis for proactive cyberbullying detection in social-media text.