Dianzi Jishu Yingyong (Apr 2021)

Sentiment analysis of Weibo based on TFIDF-NB algorithm

  • Yang Ge,
  • Yang Lutao

DOI
https://doi.org/10.16157/j.issn.0258-7998.200748
Journal volume & issue
Vol. 47, no. 4
pp. 59 – 62

Abstract

Read online

In view of the large amount of public opinion information on Weibo, irregular and random changes, this paper proposes a Weibo sentiment analysis method based on TFIDF-NB(Term Frequency Inverse Document Frequency-Naive Bayes) algorithm. By coding a Weibo comment crawler based on the Scrapy framework, several Weibo comments on a hot event are crawled and stored in the database. Then text segmentation and LDA(Latent Dirichlet Allocation) topic clustering are performed. And finally the TFIDF-NB algorithm is used for sentiment classification. Experimental results show that the accuracy of the algorithm is higher than that of the standard linear Support Vector Machine algorithm and the K-Nearest Neighbor algorithm, and it is higher than the K-Nearest Neighbor algorithm in terms of accuracy and recall, and it has a better effect on sentiment classification.

Keywords