real time hate speech detection in youtube comments using bert
Title: Real-Time Hate Speech Detection in YouTube Comments using BERT Description:This research presents a transformer-based approach for detecting hate speech in YouTube comments, leveraging the pre-trained unitary/toxic-bert model. The system is deployed within a lightweight Flask web application for real-time analysis and visualization. User-generated text from YouTube comments is noisy and unstructured, so preprocessing techniques—including removal of non-alphabetic characters, links, and emojis, as well as text normalization and truncation—were applied. The model classifies comments as either hate speech or non-hate speech with a confidence threshold of 0.7, balancing sensitivity and precision. Experiments were conducted using YouTube comments alongside benchmark datasets such as the Kaggle Toxic Comment Classification Challenge. Performance was evaluated using accuracy, precision, recall, and F1-score. Results indicate that transformer-based models, when deployed in lightweight frameworks, can effectively support automated moderation in real-world social media environments. The web application includes visualization and export functionalities, allowing moderators and researchers to manage toxic content more efficiently. This work demonstrates the practical integration of advanced NLP techniques for social media content moderation, with potential applications in real-time online safety and community management. Keywords: Hate Speech Detection, BERT, Natural Language Processing, Flask, Real-Time Analysis, YouTube Comments Additional Resources: The implementation code is available at the GitHub repository linked in the supplementary materials.
Institutions
- Baddi University of Emerging Sciences and Technologies (IN)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2025-09-19
- DOI
- https://doi.org/10.5281/zenodo.17161989
- Primary Topic
- Geochemistry and Geologic Mapping
- Type
- article
- Field-Weighted Citation Impact
- 0.00