Research on analyzing sentiment of texts based on k-nearest neighbor algorithm

In order to identify polarity of sentiment on web texts,by analyzing the text structure and the characteristics of expressing sentiment in texts,a method based on K-nearest algorithm is proposed.In this method,sentiment of a text is divided into local sentiment and global sentiment.Local sentiment can be determined by conditional random field models,and the K-nearest neighbor algorithm is used to compute global sentiment of the text.Experimental results show that compared with traditional machine learning methods,this method can analyze sentiment on multi-level and is fine granularity,and can effectively improve accuracy of sentiment analysis.