Social network-based emotional analysis IV

Source: Internet
Author: User

Social network-based emotional analysis IV
Social network-based emotional analysis IV

We have previously captured, processed, and analyzed the similarity of Weibo data, and analyzed the sentiment of Weibo in the next two articles.

Weibo sentiment analysis

Here we try to use dictionary analysis to calculate the emotional tendency of school Weibo, mainly divided into positive, negative, and objective emotions.

Here, the dictionary-based sentiment analysis and machine learning methods for sentiment analysis refer to the rzcoding blog. Here, the sentiment analysis is converted into Weibo sentiment analysis based on his ideas and code.

Dictionary Analysis

The principle of dictionary analysis is to give a microblog and determine whether there are any positive or negative emotional words in the microblog. If so, look for the degree adverbs that modify the emotional word, then calculate the positive and negative emotional scores based on the defined rules.

Dictionary analysis results

The matplotlib module is used to display the results.

Figure shows a user's sentiment analysis result of dlut (Dalian University of Technology) in a dictionary. Red indicates positive values (total values, average values, and variance in sequence ), green indicates negative values (total values, mean values, and variance in sequence) <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4NCjxwPtfWteS31s72y/fingerprint + DQoJPHRoIGFsaWduPQ = "left"> school nameWeiboNegative WeiboObjective WeiboDalian University of Technology32.7%25.5%41.8%Tsinghua University32.8%23.6%43.7%Peking University33.9%24.0%42.1%Nanjing University31.2%25.6%43.3%East China University of Political Science and Law32.4%29.0%38.6%

From the table above, we can see that the number of positive Weibo posts sent by a school is greater than that of negative Weibo posts. The proportion of positive Weibo posts is generally about 32%, while that of negative Weibo posts is generally about 24%. Ignore objective Weibo posts, so the ratio of positive Weibo posts to negative Weibo posts is generally.

Machine Learning

Machine Learning is used for sentiment analysis on Weibo, that is, related supervised learning algorithms, such as Bayesian algorithms, are used to learn with labeled emotional texts, and a classifier is obtained after training, finally, the classifier is used for sentiment classification and graphical display.
The specific steps are as follows: manually mark Weibo with positive, negative, and objective statuses. Then, all words, dual words, and chi-square statistics are used to obtain the features of words. Then, multiple machine learning models are used for training to filter out the classifier with the best accuracy. Finally, this classifier is used to classify Weibo sentiment. For example, if the positive sentiment probability is positive Weibo.

Machine Learning analysis results

Machine Learning analyzes the results of all schools.

School Name Weibo Negative Weibo Objective Weibo
Dalian University of Technology 12.6% 28.4% 59.0%
Tsinghua University 8.7% 20.3% 70.9%
Peking University 8.5% 19.0% 72.6%
Nanjing University 9.8% 23.6% 66.6%
East China University of Political Science and Law 11.9% 30.6% 57.4%

The result here is not the same as the result of dictionary analysis. In dictionary analysis, the number of positive Weibo posts sent by users is greater than the number of negative Weibo posts. Here, in five universities, the percentage of positive Weibo posts in all schools is smaller than that of negative Weibo posts. Positive Weibo accounts for about 10%, negative Weibo accounts for about 22%, and objective Weibo accounts for about 65%. Apart from objective Weibo, the ratio of positive Weibo to negative Weibo is roughly equivalent. In the experiment, the classifier accuracy reaches 70%.

Factors that affect the experiment results: first, the results are obtained based on the classifier, And the classifier is based on the labeled Weibo data. Therefore, the microblog data marked by the user has a certain impact on the determination of the classifier. Second, due to the rich Chinese Semantics, the data has different meanings in different contexts, this will make it difficult to identify the classifier and cause related errors.

Summary

The subject of this tutorial is to analyze and understand how different groups express their emotions on social networks and their tendency to express their emotions. Therefore, this study designed and implemented a complete set of processes from data capture to analysis, designed crawlers to capture data, and designed algorithms to analyze and process data. In the end, this study demonstrates the characteristics of data used in social networks and the differences in terms of different groups, it also provides answers to the question about how different groups express their emotions and their tendencies on social networks.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.