A Sentiment Analysis of Brazilian Elections Tweets

  • André Cristiani UFSCar
  • Douglas Lieira UNESP / IFSP
  • Heloisa Camargo UFSCar


The internet connection is present in people’s lives all the time, through smartphones, tablets, computers, among others. The use of social networks is increasingly common around the world. Many companies and people use them to spread products and services and publish opinions, facts that have turned the social networks into powerful sources of information on various topics. Identifying these feelings is a great strategy for many types of decision making. Thus, the purpose of this paper is to collect messages from a specific social network, in this case Twitter, referring to the 2018 Brazilian presidential elections and classify them as: positive, negative and neutral, in order to discover a possible relationship between opinions of social network users and the final outcome of the elections. For this, a corpus was built, preprocessed and evaluated by two different machine learning approaches: Naive Bayes and SVM (Support Vector Machine). The results showed that this social network is a good source of information to perform sentiment analysis and that the number of tweets classified as positive have a strong relationship with the researchers and the final result of the 2018 elections.

Palavras-chave: Social Network, Twitter, Brazilian presidential elections, Sentiment analysis


Budiharto, W. and Meiliana, M. Prediction and analysis of indonesia presidential election from twitter using sentiment analysis. Journal of Big Data 5 (1): 51, Dec, 2018.

Choi, D., Ko, B., Kim, H., and Kim, P. Text analysis for detecting terrorism-related articles on the web. Journal of Network and Computer Applications vol. 38, pp. 16–21, 2014.

Correa, I. T., Abdala, D. D., Miani, R. S., and Faria, E. R. Sentiment analysis of twitter posts about the 2017 academy awards. In Anais do XV Encontro Nacional de Inteligência Artificial e Computacional. SBC, Porto Alegre, RS, Brasil, pp. 320–331, 2018.

De Lucca, J. and Nunes, M. d. G. V. Lematização versus stemming. USP, UFSCar, UNESP, São Carlos, São Paulo, 2002.

Faria Silva, C., Caseli, H., and Teixeira, C. Classificação de tweets por relevância para concepção de um modelo de aprendizado de máquina para uso em aplicações de tv social. In Anais do XIV Encontro Nacional de Inteligência Artificial e Computacional, 2017.

Firmino Alves, A. L., Baptista, C. d. S., Firmino, A. A., Oliveira, M. G. a. d., and Paiva, A. C. d. A comparison of svm versus naive-bayes techniques for sentiment analysis in tweets: A case study with the 2013 fifa confederations cup. In Proceedings of the 20th Brazilian Symposium on Multimedia and the Web. WebMedia ’14. ACM, New York, NY, USA, pp. 123–130, 2014.

França, T. C., Faria, F., Miceli, C., Rangel, F., and Oliveira, J. Big social data: Princípios sobre coleta, tratamento e análise de dados sociais. Anais do SBBD (Porto Alegre). SBC , 2014.

Jianqiang, Z., Xiaolin, G., and Xuejun, Z. Deep convolution neural networks for twitter sentiment analysis. IEEE Access vol. 6, pp. 23253–23260, 2018.

Lacerda, W. and Braga, A. Experimento de um classificador de padrões baseado na regra naive de bayes. INFOCOMP Journal of Computer Science 3 (1): 30–35, 2004.

Lima, A. C. and de Castro, L. N. Automatic sentiment analysis of twitter messages. In 2012 Fourth International Conference on Computational Aspects of Social Networks (CASoN). IEEE, pp. 52–57, 2012.

Manning, C., Raghavan, P., and Schütze, H. Introduction to information retrieval. Natural Language Engineering 16 (1): 100–103, 2010.

Pak, A. and Paroubek, P. Twitter as a corpus for sentiment analysis and opinion mining. In LREc. Vol. 10. pp. 1320–1326, 2010.

Teixeira, D. and Azevedo, I. Análise de opinião expressas nas redes sociais. RISTI - Revista Ibérica de Sistemas e Tecnologias de Informação, 12, 2011.

Weiss, S. M., Indurkhya, N., Zhang, T., and Damerau, F. Text mining: predictive methods for analyzing unstructured information. Springer Science & Business Media, 2010.

Öztürk, N. and Ayvaz, S. Sentiment analysis on twitter: A text mining approach to the syrian refugee crisis. Telematics and Informatics 35 (1): 136 – 147, 2018.
CRISTIANI, André; LIEIRA, Douglas; CAMARGO, Heloisa. A Sentiment Analysis of Brazilian Elections Tweets. In: SYMPOSIUM ON KNOWLEDGE DISCOVERY, MINING AND LEARNING (KDMILE), 8. , 2020, Evento Online. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2020 . p. 153-160. ISSN 2763-8944. DOI: https://doi.org/10.5753/kdmile.2020.11971.