Friday, August 4, 2023

DETECTING CYBERBULLYING TWEETS USING MACHINE LEARNING AND DEEP LEARNING WITH PYTHON GUI --- SECOND EDITION (VIVIAN SIAHAAN)

 Dataset

GooglePlay Book

Amazon Kindle

Amazon Paperback

Kindle Store


This project focuses on detecting cyberbullying tweets using both Machine Learning and Deep Learning techniques with a Python GUI implemented using PyQt. The first step involves data exploration, where the dataset is loaded and analyzed to gain insights into its structure and contents. Visualizations are created to understand the distribution of cyberbullying types and other features in the data.


After data exploration, preprocessing is performed to clean and prepare the tweets for analysis. Text cleaning techniques, such as removing emojis, punctuation, links, and stop words, are applied to the tweet text. The data is then categorized based on the length of the tweets to facilitate further analysis.


Next, the data is split into input and output variables, where the tweet text becomes the input feature (X) and the cyberbullying type becomes the output (y). The cyberbullying types are converted into numerical labels for ML models' compatibility.


Machine Learning models are trained and evaluated using TF-IDF, Count Vectorizer, and Hashing Vectorizer as feature extraction techniques. SMOTE is applied to handle class imbalance, and the data is split into training and testing sets. Grid Search is utilized to find the best hyperparameters for ML models, optimizing their performance. Machine Learning models used are Logistic Regression, Support Vector Machines, K-Nearest Neighbors, Decision Trees, Random Forests, Gradient Boosting, Extreme Gradient Boosting, Light Gradient Boosting.


Moving to Deep Learning, LSTM (Long Short-Term Memory) and 1D CNN (Convolutional Neural Network) models are constructed to detect cyberbullying types. The tweet text is embedded, and various layers are added to the models to extract meaningful features. The models are then compiled with appropriate loss functions and optimizers.


The evaluation process is carried out using the test set for both Machine Learning and Deep Learning models. Metrics like accuracy, precision, recall, and F1-score are used to assess the models' performance in detecting cyberbullying types.


To enable easy access to the functionalities, a Graphical User Interface (GUI) is developed using PyQt. The GUI allows users to interact with the models and dataset easily. Users can select the feature extraction technique, choose the classifier, and initiate the model training process using the GUI's buttons and dropdown menus.

For better data visualization, the GUI includes various plots, such as bar plots and pie charts, to show the distribution of cyberbullying types and other features. These visualizations help users understand the data and model performance intuitively.


The final stage involves testing the GUI with different inputs and exploring model predictions on user-provided text. The GUI provides predictions for the given tweet text, indicating the likelihood of each cyberbullying type based on the trained models.


Overall, this project combines data exploration, preprocessing, feature extraction using Machine Learning and Deep Learning models, GUI development, and data visualization to detect cyberbullying tweets effectively and provide an accessible interface for users to interact with the models. The end product allows users to analyze tweets for potential cyberbullying and contributes to promoting a safer and more respectful online environment.




















No comments:

Post a Comment