- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的文字来源于一个社交网络,所以你可以想象它的本质,我认为文字是我想象中的干净和最小的;执行以下 sanitizer 后:
我认为运行时是线性的,我不打算进行任何并行化,因为更改可用代码需要付出大量努力,例如,对于大约 1000 条从 ~50 kb 到 ~150 kb 字节的文本,它需要大约
在我的机器上运行时间约为 10 分钟。
是否有更好的方法来提供算法以加快 cooking 时间?代码与 SentimentIntensityAnalyzer 旨在工作的一样简单,这里是主要部分
sid = SentimentIntensityAnalyzer()
c.execute("select body, creation_date, group_id from posts where (substring(lower(body) from (%s))=(%s)) and language=\'en\' order by creation _ date DESC (s,s,)")
conn.commit()
if(c.rowcount>0):
dump_fetched = c.fetchall()
textsSql=pd.DataFrame(dump_fetched,columns=['body','created_at', 'group_id'])
del dump_fetched
gc.collect()
texts = textsSql['body'].values
# here, some data manipulation: steps listed above
polarity_ = [sid.polarity_scores(s)['compound'] for s in texts]
最佳答案
/1。您不需要删除停用词,nltk+vader 已经这样做了。
/2。您无需删除标点符号,因为除了处理开销外,这也会影响 vader 的极性计算。所以,继续使用标点符号吧。
>>> txt = "this is superb!"
>>> s.polarity_scores(txt)
{'neg': 0.0, 'neu': 0.313, 'pos': 0.687, 'compound': 0.6588}
>>> txt = "this is superb"
>>> s.polarity_scores(txt)
{'neg': 0.0, 'neu': 0.328, 'pos': 0.672, 'compound': 0.6249}
/3.你也应该引入句子标记化,因为它会提高准确性,然后根据句子计算一个段落的平均极性。这里的例子:https://github.com/cjhutto/vaderSentiment/blob/master/vaderSentiment/vaderSentiment.py#L517
/4。极性计算彼此完全独立,可以使用 multiprocessing pool对于小尺寸,比如 10,可以很好地提高速度。
polarity_ = [sid.polarity_scores(s)['compound'] for s in texts]
关于python - 有没有办法提高 nltk.sentiment.vader 情感分析的性能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45296897/
我正在使用reactjs-popup,它的 Prop 之一是contentStyle,它允许您传递css-in-js对象来设置库中内部div的样式。 但是,当我传递带有 @media 的 css 对象
在查看了一些服务/工具之后,我得出了一个结论。大多数 Text-to-Speech 工具的技术含量太高、太机械化——换句话说,就是质量差的 c 语音。 是的,最重要的是,看起来它们带有“硬编码”语音模
我正在尝试使用 Emotion.sh在我的 React 测试元素中,但我使用与 example 中相同的代码得到以下错误 需要考虑的可能有冲突的事情:1、之前用的是npm,现在用的是yarn;2. 我
通过以下链接,我有了一些想法。我想问问我是做对了还是做错了。如果我走错了路,请指导我。 链接 Using libsvm for text classification c# How to use li
以下设置不显示background-image。作为调试步骤,我尝试在 const background 中设置 background: pink,这确实有效,确认 emotion 正在正确运行。 打
我有一个 data.frame,其中包含周数 week 和文本评论 text。我想将 week 变量视为我的分组变量,并对它运行一些基本的文本分析(例如 qdap::polarity)。一些评论文本有
我正在研究 Kaggle 电影情感分析,我发现电影评论已使用 Standford Parser 进行了解析。在探索数据集时,我发现相同的语句给出了不同的设置- their parents , wise
我正在尝试使用Affectiva emotion sdk 制作一个演示程序。但是,当我调用 detector.setLicensePath() 时,会抛出一个异常(见下图)。有谁知道如何解决这个问题?
我想设置一个使用 Material-UI v4.11.4 的 Typescript 项目来使用情感进行样式设置,为 MUI v5 版本做准备。目标是在项目中引入情感,以便开发人员可以开始使用新样式,而
我是一名优秀的程序员,十分优秀!