Research Article

Sentiment Analysis of Twitter Comments Using Naive Bayes Classifier

Ziyao ZhangChina University of Geosciences*

* Corresponding author: [email protected]

Abstract

Social media has a significant role in how people express their emotions and elaborate on their opinions in today's culture. There are many new forms of social media, and Twitter is one of them. In this experiment, the sentiment of pre-processed Twitter comment data was examined using naive Bayes and logistic regression techniques. In order to categorise the emotional tendency of text for Twitter comments, a naive Bayesian classifier is created. In processing this material, the Naive Bayes and logistic regression models' benefits and drawbacks are compared and summarised. Naive Bayes can achieve good accuracy with binary emotion analysis. The accuracy of the naive Bayes model is 0.06 points higher than that of logic training under identical processing settings, and the recall rate is 0.05 points higher.

Keywords: naive bayes; sentiment analysis; Twitter comment; natural language processing; machine learning
Published: October 31, 2023
DOI: 10.54254/2753-7064/10/20231338
Volume: CHR Vol.10
pp. 262-268
Download PDF

References

  1. Chen Long, Guan Yu, He Jinhong, Peng Jinye. Research Progress in Sentiment Classification [J]. Journal of Computer Research and Development,2017,54(06):1150-1170.
  2. C. Troussas, M. Virvou, K. J. Espinosa, K. Llaguno and J. Caro, "Sentiment analysis of Facebook statuses using Naive Bayes classifier for language learning," IISA 2013, Piraeus, Greece, 2013, pp. 1-6, doi: 10.1109/IISA.2013.6623713.
  3. Lin Jianghao, Yang Aimin, Zhou Yongmei et al. A Naive Bayes based microblog Sentiment Classification [J]. Computer Engineering and Science,2012, 34(09):160-165.
  4. Lu Ling, Wang Yue, Yang Wu. A Naive Bayes-based sentiment Classification Method for Chinese Comments [J]. Journal of Shandong University (Engineering Science),2013,43(06):7-11.
  5. Y. Jianqiang and G. Xiaolin, "Comparison Research on Text Pre-processing Methods on Twitter Sentiment Analysis," in IEEE Access, vol. 5, pp. 2870-2879, 2017, doi: 10.1109/ACCESS.2017.2672677.
  6. Li Jingmei, Sun Lihua, Zhang Qiarong, et al. A naive Bayesian classifier for Text Processing [J]. Journal of Harbin Engineering University,2003(01):71-74.
  7. Combine HowNet lexicon to train phrase recursive autoencoder for sentence-level sentiment analysis[J]. Xianghua Fu; Wangwang Liu; Yingying Xu; Laizhong Cui.Neurocomputing,2017.
  8. Maron M E, Kuhns J L. On relevance, probabilistic indexing and information retrieval [J]. Journal of the ACM(JACM),1960,7(3):216-244.
  9. Lewis D D. Naive(Bayes)at forty: The independence assumption in information retrieval[C]//Machine learning: ECML-98.Springer Berlin Heidelberg,1998:4-15.
  10. EDITH LAW, BURR SETTLES, TOM MITCHELL.Machine learning and knowledge discovery in databases[M]. Springer Berlin Heidelberg:2010.