MétaCan
Menu
Back to cohort

Toxic Language and Threat Detection in Social Media

2025· article· W7125606400 on OpenAlexaff
Nafiseh Jabbari Tofighi, Hessam Kaveh, Kashfia Sailunaz, Abdallah M. ElSheikh, Ziad Elgammal, Said AbuShaar, M. Kemal Özdemir, Jon Rokne

Bibliographic record

Venuenot available
Typearticle
Language
FieldComputer Science
TopicHate Speech and Cyberbullying Detection
Canadian institutionsUniversity of CalgaryDalhousie University
Fundersnot available
KeywordsSocial mediaThe InternetAction (physics)Misinformation

Abstract

fetched live from OpenAlex

Detecting toxic language and threats in social media is a critical task for ensuring safer online interactions and preventing the spread of harmful content. This paper presents a comprehensive approach to toxic language and threat detection using both traditional machine learning and state-of-the-art deep learning models. The study leverages two widely used datasets: the Jigsaw Toxic Comment Classification Dataset, which contains over 150,000 labeled comments categorized as toxic, severe toxic, obscene, threats, insults, and identity hate, and the Hate Speech Dataset, which classifies tweets into hate speech, offensive language, and neutral speech. To develop an efficient detection system, we explore a range of models including traditional classifiers such as Logistic Regression and Naïve Bayes, deep learning architectures like Long Short-Term Memory (LSTM) and Convolutional Neural Networks (CNN), and advanced transformer-based models such as BERT and RoBERTa. Each model is evaluated based on multiple performance metrics, including accuracy, precision, recall, F1-score, and AUC-ROC, to ensure a fair comparison. Our experimental results show that Logistic Regression achieves an overall accuracy of 94%, outperforming Naïve Bayes, which struggles with class imbalance, particularly in detecting minority classes like threats and hate speech. Deep learning models, including LSTM and CNN, improve performance by capturing the sequential structure of text. However, the best results are obtained with transformer-based architectures, where BERT achieves the highest accuracy of 96%, demonstrating its superior ability to capture contextual dependencies in toxic comments. Additionally, our study explores the impact of data preprocessing techniques, including text cleaning, tokenization, lemmatization, and class balancing using SMOTE (Synthetic Minority Over-sampling Technique). Our findings suggest that while classical machine learning models can provide a solid baseline, deep learning and transformers significantly enhance detection capabilities, especially in complex cases involving sarcasm, implicit threats, and nuanced hate speech.

Fetched live from OpenAlex and de-inverted. Abstracts are not stored in this database: the inverted indexes are 8.6 GB of the frame’s 9.3 GB of text, and the host has 13 GB free.

How this classification was reachedexpand

Full frame distilled prediction

Teacher imitation

Not calibrated prevalence, not ground truth. Human validation pending. Learned from the 10,348 direct Codex labels and 10,348 direct Gemma labels. Candidate is the union of thresholded teacher heads; consensus is their intersection. These outputs are machine_predicted_unvalidated and are not human labels or direct frontier model labels.

metaresearch head score (Codex)0.000
metaresearch head score (Gemma)0.000
Version: codex-gemma-dda1882f352aValidation status: machine_predicted_unvalidated
Candidate categoriesnone
Consensus categoriesnone
DomainCandidate signal: none · Consensus signal: none
Study designCandidate signal: Other design · Consensus signal: none
GenreCandidate signal: Empirical · Consensus signal: Empirical
Teacher disagreement score0.969
Threshold uncertainty score0.691

Codex and Gemma teacher scores by category

CategoryCodexGemma
Metaresearch0.0000.000
Meta-epidemiology (narrow)0.0000.000
Meta-epidemiology (broad)0.0000.000
Bibliometrics0.0000.001
Science and technology studies0.0000.000
Scholarly communication0.0000.000
Open science0.0000.000
Research integrity0.0000.000
Insufficient payload (model declined to judge)0.0000.000

Machine scores (provisional)

The two teacher heads of the student model, read on this work. A score orders the frame for review; it never asserts a category, and the validation status ships verbatim with every row.

Baseline scores from an immature model (maturity gate not passed, 7 training rounds). Scores rank; they never assert a category.

Opus teacher head0.009
GPT teacher head0.246
Teacher spread0.237 · how far apart the two teachers sit on this one work
Validation statusscore_only:v0-immature-baseline · verbatim from the scoring run: score_only means the number may rank works, and no category label ships from it

Classification

machine, unvalidated

Machine predicted; a candidate call from one teacher head, not a consensus.

The models applied no category: nothing in the taxonomy fit this work.
Study designOther design
Domainnot available
GenreEmpirical

How this classification was reached, model by model and score by score, is at the end of the page under "How this classification was reached".

Quick stats

Citations0
Published2025
Admission routes1
Has abstractno

Explore more

Same topicHate Speech and Cyberbullying DetectionFrench-language works237,207