Dianzi Jishu Yingyong (Apr 2021)
Sentiment analysis of Weibo based on TFIDF-NB algorithm
Abstract
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