任伟 刘循



【摘要】 随着互联网行业的发展,各式各样的网站不断兴起,用户在网上发帖留言已经成为一种常态,对用户的留言进行情感分析,分析用户的情感倾向和主观情感已经变得越来越流行。首先,本文用基于情感词典的情感分析方法对用户的情感进行分析,为用户的每一条回帖计算其正向情感分值和负向情感分值得以及计算其 正向情感词数目和负向情感词数目,最后以用户为单位,计算均值,得到每个用户的情感特征向量,我们根据用户的情感特征向量,对用户进行聚类分析,探究用户的行为模式有什么不同点和相同点。
关键字:情感分析;KMeans;聚类分析
User cluster analysis based on sentiment feature
REN - wei, LIU- xung (School of Computer, Sichuan University, Chengdu 610065, China)
Abstract: With the development of Internet,all kinds of website becomes popular,users like to leave somemessages on it.That is a good resource for us to analysis sentiment for every user.
This paper uses a dictionary-based method to analysis users sentiment.we calculate thepositive points,negative points,the number of positive word and the number of negative word for every message.then get a mean value of them as a feature vecture for every user.At last,we can use the KMeans algorithe to cluster them and analysis the way when people leave a message.
Keywords:KMeans; cluster; sentiment analysis
一、用户情感分析
本文采用的是基于情感字典的情感分析方法.
1.1 原理
比如这么一句话:“这手机的画面极好,操作也比较流畅。不过拍照真的太烂了!系统也不好。”
① 情感词
要分析一句话是积极的还是消极的,最简单最基础的方法就是找出句子里面的情感词,积极的情感词比如:赞,好,顺手,华丽等,消极情感词比如:差,烂,坏,坑爹等。出现一个积极词就+1,出现一个消极词就-1。
里面就有“好”,“流畅”两个积极情感词,“烂”一个消极情感词。那它的情感分值就是1+1-1+1=2. 很明显这个分值是不合理的,下面一步步修改它。
② 程度词
“好”,“流畅”和‘烂“前面都有一个程度修饰词。”极好“就比”较好“或者”好“的情感更强,”太烂“也比”有点烂“情感强得多。所以需要在找到情感词后往前找一下有没有程度修饰,并给不同的程度一个权值。……