nltk vader_lexicon.txt 加载失败

apeeds0o  于 2个月前  发布在  其他
关注(0)|答案(2)|浏览(21)

大家好 -已经困扰我一周了
使用SentimentIntensityAnalyzer,当我尝试nltk.download("vader_lexicon")时,一直遇到LookupError
我也尝试过添加vader_lexicon的数据路径,但仍然没有成功
我正在使用Ubuntu系统
请帮帮我

xdnvmnnf

xdnvmnnf1#

很遗憾,我无法重现这个问题:

>>> import nltk
>>> nltk.download("vader_lexicon")
[nltk_data] Downloading package vader_lexicon to
[nltk_data]     [sic]\nltk_data...
True
>>>

不过,我现在正在使用Windows进行测试。
你是否能够下载其他NLTK数据?否则,你可以手动从 https://github.com/nltk/nltk_data/tree/gh-pages/packages/sentiment 下载文件并将其放置在 nltk_data/sentiment/vader_lexicon.zip 下。
希望这能帮到你一点。

00jrzges

00jrzges2#

很遗憾,我已经尝试过了:/问题是关于Ubuntu或者我想要实现的目标
谢谢你:)

相关问题