使用Lingpipe在情感分析中识别实体 [英] Identifying the entity in sentiment analysis using Lingpipe

查看:396
本文介绍了使用Lingpipe在情感分析中识别实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Lingpipe的情感分析模块实现了情感分析.我知道他们为此使用了动态LR模型.它只是告诉我测试字符串是肯定的情绪还是否定的情绪.我可以使用什么想法来确定表达情感的对象?

I have implemented sentiment analysis using the sentiment analysis module of Lingpipe. I know that they use a Dynamic LR model for this. It just tells me if the test string is a positive sentiment or negative sentiment. What ideas could I use to determine the object for which the sentiment has been expressed?

如果文本被归类为正面情绪,我想获得表达情绪的对象-这可以是电影名称,产品名称或其他.

If the text is categorized as positive sentiment, I would like to get the object for which the sentiment has been expressed - this could be a movie name, product name or others.

推荐答案

尽管这个问题确实很老,但我想为他人的利益回答.

Although this question is really old but I would like to answer it for others' benefit.

这里想要的是概念层次的情绪分析.对于非常基本的版本,我建议执行以下步骤:

What you want here is concept level sentiment analysis. For a very basic version, I would recommend following these steps:

  1. 应用句子拆分器.您可以使用Lingpipe的句子拆分器或OpenNLP句子检测器.

  1. Apply sentence splitter. You can either use Lingpipe's Sentence Splitter or the OpenNLP Sentence Detector.

应用视觉标记.同样,您可以使用Lingpipe的POS标记器或OpenNLP POS Tagger.

Apply part-of-spech tagging. Again you can either use Lingpipe's POS tagger or OpenNLP POS Tagger.

然后,您需要识别由POS标记器标识为"名词"的令牌.这些标记有可能成为句子中的目标实体.

You then need to identify tokens(s) identified as 'Nouns' by the POS tagger. These token(s) have the potential of being the targeted entity in the sentence.

然后,您需要在句子中找到情感词.最简单的方法是使用带有情感词的词典.您可以在线上找到许多这样的词典.

Then you need to find sentiment words in the sentence. The easiest way to do this is by using a dictionary of sentiment bearing words. You can find many such dictionaries online.

下一步将找出句子中的依存关系.这可以通过使用斯坦福依赖性解析器来实现.例如,如果您在他们的这部手机很好." ="nofollow">在线演示,您可以看到以下类型化依赖项":

The next step will be find out dependency relations in sentences. This can be achieved by using the Stanford Dependency Parser. For example, if you try out the sentence - "This phone is good." in their online demo, you can see the following 'Typed Dependencies':

det(电话2,此1), nsubj(good-4,电话2), cop(good-4,is-3), 根(ROOT-0,good-4)

det(phone-2, This-1), nsubj(good-4, phone-2), cop(good-4, is-3), root(ROOT-0, good-4)

依赖项 nsubj(good-4,电话2)在这里表示电话是令牌的标称主题.好,表示单词表示电话.我确定您的情感词典中将包含单词 good phone ,这将被POS标记器识别为名词.因此,您可以得出结论,对实体电话表示了的情绪.

The dependency nsubj(good-4, phone-2) here indicates that phone is the nominal subject of the token good, implying that the word good is expressed for phone. I am sure that your sentiment dictionary will contain the word good and phone would have been identified as a noun by the POS tagger. Thus, you can conclude that the sentiment good was expressed for the entity phone.

这是一个非常基本的示例.您可以更进一步,并围绕依赖关系创建规则以提取更复杂的情感-实体对.您还可以为情绪术语分配分数,并根据句子中情绪词出现的次数得出句子的总分数.

This was a very basic example. You can go a step further and create rules around the dependency relations to extract more complex sentiment-entity pairs. You can also assign scores to your sentiment terms and come up with a total score for the sentence depending upon the number of occurrences of sentiment words in that sentence.

这篇关于使用Lingpipe在情感分析中识别实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆