微博言论往往带有强烈的情感色彩,对微博言论的情感分析是获取用户观点态度的重要方法。许多学者都是将研究的重点集中在句子词性、情感符号以及情感语料库等方面,然而用户自身的情感倾向性并没有受到足够的重视,因此,提出了一种新的微博情感分类方法,其通过建模用户自身的情感标志得分来帮助识别语句的情感特征,具体地讲,将带有情感信息的微博语句词向量序列输入到长短期记忆网络(LSTM),并将LSTM输出的特征表示与用户情感得分进行结合作为全连接层的输入,并通过Softmax层实现了对微博文本的情感极性分类。实验表明,提出的方法UA-LSTM在情感分类任务上的表现超过的所有基准方法,并且比最优的基准方法MF-CNN在F1值上提升了34%,达到091。
关键词: 情感分析, 长短期记忆网络, 用户情感倾向
Abstract:
Micro-blog's speech often has strong sentimental color, and the sentiment analysis of Micro-blog's speech is an important way to get users' opinions and attitudes Many researchers conduct research via focusing on the parts of speech (POS), emotion symbol and emotion corpus This paper proposes a novel method for Micro-blog sentiment analysis, which aims to identify the sentiment features of a text by modeling user sentiment tendency Specifically, we construct a sentiment information embedded word embedding sequence, and input it into a long short term memory (LSTM) model to get a sentiment embedded output representation Then we merge both the user sentiment tendency score and the output representation of LSTM, and use it as the input of a fully connected layer which is followed by a softmax layer to get the final sentiment classification result The experiment shows that the performance of our proposed method UA-LSTM is better than all the baseline methods on the sentimental classification task, and it achieves the F1-score up to 091, with an improvement of 34% over the best baseline method MF-CNN
最近王和李的离婚闹得沸沸扬扬,相信大伙们都已经吃了不少的瓜。本文结合李的第一篇文章发文下面的网友们的评论来看看大家到底怎么看待这件事。
数据来自该地址: https://weibocom/5977512966/L6w2sfDXb#comment
爬取的下面的全部评论:
微博的网页属于Ajax渲染,当我们向下滑动的时候会显示的评论,地址栏的URL不变,需要找到实际的请求URL。
1、右击检查,找到Network
2、确定每页的内容URL
这里是首页部分
滑动之后显示每页内容的URL;
3、每页的URL地址
从第二页开始的URL地址多的部分是max_id,刚好这个参数的值是前一页的返回内容:
4、介绍第一页的爬取
比如我们可以获取第一个用户的相关信息:
最终我们可以看到第一页爬取的数据展示:
参考上面的逻辑可以爬取到微博下面的全部评论
导入需要的库:
查看我们爬取到数据的基本信息,我们导入前5行数据:
基本信息:查看数据的shape形状,总共是47638行,8个字段,并且不存在缺失值。
将我们爬取到的格林威治形式的时间转成熟悉的标准化时间形式:
国内的省份中北京、广东、上海、江苏都是吃瓜的大省份!
果然:女性真的很爱吃瓜
欢迎分享,转载请注明来源:浪漫分享网
评论列表(0条)