Machine learning-based sentiment analysis to determine social perception of Generation Z on Twitter/X
Hugo Vega-Huerta, Luis Casaperalta-Pacheco, Frida López-Córdova, Adegundo Camara-Figueroa, Rubén Gil-Calvo, William Enriquez, Juan Carlos Lázaro-Guillermo, Jessy Isabel Vargas Flores, Mario Chauca, Jose Luis Cuya-Camara, Ivan Adrianzén-Olano, Katherin Vanessa Rodriguez-Zevallos
The arrival of Generation Z in the social and work environment has sparked a heated debate on social media, marked by a division between innovative visions and critical stereotypes. This research develops a sentiment analysis model based on machine learning to understand public perception of this population group. Using a dataset obtained from Twitter/X through content and data extraction from the web with the Octoparse tool, three classification algorithms were trained and evaluated: Support Vector Machines (SVM), Random Forest, and Long Short-Term Memory (LSTM). Due to the class imbalance inherent in generational discussions, data balancing techniques (SMOTE, ADASYN) were applied. The results indicate that the Optuna-optimized LSTM model with SMOTE+Tomek balancing performed best with an accuracy of 82.39%, outperforming classical approaches. This tool allows for the identification of opinion trends (positive, negative, or neutral) about Generation Z, providing valuable input for sociologists and organizations seeking to understand the dynamics of “Generation Z” or “Centennials.”