- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想使用 spacy 来获取某些句子的极性,我有以下代码:
import spacy
if __name__ == "__main__":
nlp = spacy.load("en_core_web_lg")
test_text = ['that is a great news','the book is very bad']
sentiment = {'polarity':[]}
for text in test_text:
doc = nlp(unicode(text))
print (doc.sentiment)
但我在所有情况下都得到 0.0。
为什么会这样呢?显然两个句子的极性不一样
最佳答案
尽管文档将 sentement
列为文档属性,但 spaCy 模型并未附带情感分类器。要做情感分类,首先要训练自己的模型following this example .
关于python - Spacy 极性/情感方法不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59131400/
我想使用 spacy 来获取某些句子的极性,我有以下代码: import spacy if __name__ == "__main__": nlp = spacy.load("en_core_
我想使用 spacy 来获取某些句子的极性,我有以下代码: import spacy if __name__ == "__main__": nlp = spacy.load("en_core_
我正在尝试使用 Z3 解决具有 12000 多个 bool 变量的 SAT 问题。 我希望大多数变量在解决方案中都会评估为假。 有没有办法引导或提示 Z3 作为 SAT 求解器首先尝试“极性错误”?
假设我有: In [1]: df = pl.DataFrame({'a': [[1,2], [3,4]]}) In [2]: df Out[2]: shape: (2, 1) ┌───────────
我有一个 data.frame,其中包含周数 week 和文本评论 text。我想将 week 变量视为我的分组变量,并对它运行一些基本的文本分析(例如 qdap::polarity)。一些评论文本有
我是一名优秀的程序员,十分优秀!