Automated analysis of hate speech and incivility on X: elections in Peru (2021) and Colombia (2022); [Análise automatizada de discursos de ódio e incivilidade no X: eleições do Peru (2021) e da Colômbia (2022)]
Macassi S.; Crawford-Visbal J.L. · Cuadernos.info (2026) · DOI: 10.7764/cdi.64.98952
Resumen
This study analyzes incivility and hate speech in the presidential campaigns of Peru (2021) and Colombia (2022) based on 3,193 tweets collected from the official accounts of Keiko Fujimori, Pedro Castillo, Gustavo Petro, and Rodolfo Hernández. We used a hybrid approach, combining automatic natural language processing (Spanish NLP) with manual validation. From the 3,193 tweets, the sample was refined to 1,926 valid tweets, and random manual validation was performed on 545 tweets. The model was adapted using a dictionary of local colloquialisms. Colombian candidates presented higher average values: incivility of 0.20 (Petro) and 0.24 (Hernández); hate speech of 0.015 and 0.018. In Peru, Fujimori reached 0.16 and 0.006; Castillo 0.18 and 0.01. Both indicators decreased in the runoff. The adjusted model more closely matched manual validation, confirming the effectiveness of adaptation to specific linguistic contexts. Moderation in the runoff aligns with studies on the voluntary reduction of these resources to broaden support. In Peru, incivility was lower and hate speech was almost residual. Colombia showed higher levels in both indicators. It is concluded that incivility and hate speech function as strategic tools shaped by electoral competition, and that the hybrid approach is robust for analyzing digital political communication in Latin America.
Instituciones: Pontificia Universidad Católica del Perú