Deep Learning for Hate Speech Intensity Analysis: DistilBERT Classification Algorithm
Slamet Riyadi, Ahmad Musthafa Masyhur, Annisa Divayu Andriyani · 2024
This paper investigates the escalating issue of hate speech on Twitter in Indonesia. With a focus on distinguishing between weak and strong forms of hate speech, the study aims to leverage the DistilBERT model for classification. By employing oversampling techniques to balance datasets, the research seeks to enhance hate speech detection accuracy, offering insights for fostering social peace and tolerance within society. The research methodology involves utilizing the DistilBERT model for hate speech classification on Twitter data. Through data preprocessing, model setup, and training, the study employs oversampling techniques to address class imbalances. The DistilBERT-based model is optimized for multi-label classification, with dynamic learning rate scheduling enhancing model convergence. Evaluation involves assessing performance metrics, including accuracy, loss, and F1 score. Training on both imbalanced and balanced datasets reveals significant differences in model performance. While both models show improvement post-training, the balanced dataset outperforms in terms of accuracy (0.98519) and F1 score (0.99815). Testing metrics underscore the efficacy of dataset balancing strategies, with fine-tuning further enhancing model performance with a test accuracy of 0.98370 and test loss of 0.08160. Visual representations aid in interpreting training progress and model effectiveness in hate speech classification. The study underscores the importance of dataset preprocessing in hate speech classification tasks. By employing oversampling techniques to address class imbalances, the research demonstrates enhanced model performance and reliability, particularly with the balanced dataset. Future endeavors may explore advanced techniques like ensemble learning and assess model robustness across languages and social media platforms for effective hate speech mitigation.