为了识别网络文本的情感倾向性,通过分析文本结构以及情感表达的特点,提出了一种基于k-近邻的文本情感分析方法,将整个文本的情感划分为局部情感和全局情感。建立条件随机场模型,确定文本中的局部情感,通过k-近邻算法计算文本的全局情感。实验结果表明,与传统机器学习方法相比,该方法能细粒度、多层次的分析文本的情感,同时能有效提高情感分析的准确率。
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. Experimemal 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.