- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Hugging-face pipeline 进行情绪分析任务,它会给出正面/负面情绪以及置信度分数。就我而言,我需要三个输出(正面/中性/负面)。问题是即使是中性句子(例如:“他有她有”),拥抱脸也给我很高的信心分数?有什么建议吗?
from transformers import pipeline
model = pipeline(task = 'sentiment-analysis')
sentence = 'some text to evaluate'
predicted = model(sentence)
print(predicted)
以下是一些输出示例:
----------------------------------------------
sentence = 'I love you'
predicted = model(sentence)
predicted
[{'label': 'POSITIVE', 'score': 0.9998656511306763}]
----------------------------------------------
sentence = 'I hate you'
predicted = model(sentence)
predicted
[{'label': 'NEGATIVE', 'score': 0.9991129040718079}]
----------------------------------------------
sentence = 'I have she had'
predicted = model(sentence)
predicted
[{'label': 'POSITIVE', 'score': 0.9821817874908447}]
----------------------------------------------
sentence = 'I go to work'
predicted = model(sentence)
predicted
[{'label': 'POSITIVE', 'score': 0.9457777738571167}]
----------------------------------------------
sentence = 'This movie was actually neither that funny, nor super witty.'
predicted = model(sentence)
predicted
[{'label': 'NEGATIVE', 'score': 0.9997298121452332}]
最佳答案
您可以使用 model确实包含一个 neutral
标签,this模型例如:
model = pipeline('sentiment-analysis', model="finiteautomata/bertweet-base-sentiment-analysis")`
关于python - 从 Huggingface 模型中提取中性情绪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69726643/
我目前正在做一个项目,我必须提取用户的面部表情(网络摄像头一次只能提取一个用户),比如悲伤或快乐。 目前我发现的最佳可能性: 我使用 OpenCV 进行人脸检测。 OpenCV 开发板上的一些用户建议
此代码来自Facebook Chat Emoticons Bar Grease Monkey UserScript ImagesURL = HttpsOn?'https://s-static.ak.f
我正在寻找一种可以分析短文本情感的工具。我搜索了一个星期,但找不到一个可以公开获得的好的。理想的工具是将短文本作为输入并猜测情感的工具。它最好是一个独立的应用程序或库。 我不需要通过文本训练的工具。而
是否有任何简单的 Android/Java 库/框架可以检测图片上的人脸并给我一些关于图片上的人的信息?我的意思是诸如性别、年龄、情绪(微笑、悲伤、愤怒)之类的信息...... 我试过Face++和微
我下载了WN-Affect .但是,我不确定如何使用它来检测句子的情绪。例如,如果我有一个字符串“我讨厌足球”。我希望能够检测情绪是否不好,情绪是否是恐惧。 WN-Affect 没有关于如何操作的教程
现在,Skype 将淘汰其桌面 API 以支持 Skype URI,我正在尝试弄清楚如何修改状态和情绪消息。我的应用程序是一个 chrome 扩展程序,使用它的人都知道它的作用。它是一个合法的用例。目
我有这个: import styled from 'react-emotion'; const Box = styled('div')` display: flex; flex-directi
我是一名优秀的程序员,十分优秀!