python 多分类情感_python-识别文本中的多个类别和相关的情感

如果您有一个文本语料库,如何识别所有类别(从预定义类别列表中)和相关的情感(正面/负面写作)?

我将在Python中进行此操作,但在此阶段,我不一定要寻找特定于语言的解决方案.

让我们看一个例子,尝试阐明我的要求.

如果我对产品有完整的评论集,例如:

Microsoft’s Xbox One offers impressive graphics and a solid list of exclusive 2015 titles. The Microsoft console currently edges ahead of the PS4 with a better selection of media apps. The console’s fall-2015 dashboard update is a noticeable improvement. The console has backward compatibility with around 100 Xbox 360 titles, and that list is poised to grow. The Xbox One’s new interface is still more convoluted than the PS4’s. In general, the PS4 delivers slightly better installation times, graphics and performance on cross-platform games. The Xbox One also lags behind the PS4 in its selection of indie games. The Kinect’s legacy is still a blemish. While the PS4 remains our overall preferred choice in the game console race, the Xbox One’s significant course corrections and solid exclusives make it a compelling alternative.

我有一个预定义类别的列表,例如:

>图形

>游戏玩法

>游戏选择

>应用

>表现

>不相关/其他

我可以接受大量的评论,然后按句子将其分解.对于我的训练数据中的每个句子,我都可以为其手工标记适当的类别.问题在于1个句子中可能有各种类别.

如果每个句子只有1个类别,那么scikit-learn的任何分类算法都可以解决问题.当使用多类时,我可以使用多标签分类之类的方法.

增加情绪是比较棘手的部分.识别句子中的情感是一项相当简单的任务,但是如果不同标签上的情感混合在一起会变得不同.

例句为“ Xbox One拥有不错的游戏选择,但性能比PS4差”.我们可以确定两个预定义的类别(游戏选择,性能),但是我们对游戏选择抱有积极的态度,而对表现则抱有消极的想法.

用什么方法识别文本中的所有类别(来自我们的预定义列表)及其相关情感?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值