Sentiment analysis of microblog data based on TextCNN
Bowen Zheng, Weihao Fang, Fei Deng, Xiyi Miao · 2025
With the rapid development of social media, Microblog comments have become an important source of data for understanding public emotions. But Microblog content is usually casual and short, which is a challenge for traditional emotion analysis methods. This study designed a complete emotion analysis process based on TextCNN. Using Scrapy combined with Selenium technology to bypass anti crawling mechanisms and efficiently capture comment data. The preprocessing process includes removing meaningless words, using Jieba segmentation, and combining hidden Markov models to improve accuracy, and then converting words into vector form through Word2Vec Skip gram. The TextCNN model uses convolutional kernels of different sizes to extract emotional features, and after max pooling and fully connected layers, divides the text into seven emotional categories. Finally, use Matplotlib and Pyecharts to visualize the results, presenting the distribution of emotions and user engagement. This method effectively alleviates the problem of insufficient semantic information in short texts and has good adaptability to common informal expressions on Microblog. This framework provides practical support for public opinion monitoring and real-time sentiment analysis in social media environments.