【问题标题】:Adding Stopwords while Using TextBlob使用 TextBlob 时添加停用词
【发布时间】:2020-09-07 00:22:50
【问题描述】:

对于情绪分析项目,我尝试在使用 TextBlob 时添加停用词。我也尝试过结合 NTLK 脚本,但没有运气。这是我在尝试添加停用词之前的代码。

import csv
from textblob import TextBlob

infile = 'File Path'

with open(infile, 'r') as csvfile:
    rows = csv.reader(csvfile)
    for row in rows:
        sentence = row[0]
        blob = TextBlob(sentence)        
        print (blob.sentiment_assessments)

【问题讨论】:

    标签: python stop-words textblob


    【解决方案1】:

    Adding words to nltk stoplist 可能重复

    但是,如果这是一个拼写错误并且您确实想要删除停用词,那么Stopword removal with NLTKRemoving stopwords from a textblob 的重复可能仍然存在 此外,您应该查看 textblob 开发者的问题部分中提到的以下问题:https://github.com/sloria/TextBlob/issues/153

    但是,如果您仍然不清楚,请使用示例代码详细说明确切的问题。

    【讨论】:

    • 谢谢。我会尽快回到项目中进行调查。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-05-01
    • 2012-10-15
    • 2021-07-24
    • 2014-02-03
    • 1970-01-01
    • 1970-01-01
    • 2017-12-15
    相关资源
    最近更新 更多