大家好 -已经困扰我一周了使用SentimentIntensityAnalyzer,当我尝试nltk.download("vader_lexicon")时,一直遇到LookupError我也尝试过添加vader_lexicon的数据路径,但仍然没有成功我正在使用Ubuntu系统请帮帮我
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 下。希望这能帮到你一点。
nltk_data/sentiment/vader_lexicon.zip
00jrzges2#
很遗憾,我已经尝试过了:/问题是关于Ubuntu或者我想要实现的目标谢谢你:)
2条答案
按热度按时间xdnvmnnf1#
很遗憾,我无法重现这个问题:
不过,我现在正在使用Windows进行测试。
你是否能够下载其他NLTK数据?否则,你可以手动从 https://github.com/nltk/nltk_data/tree/gh-pages/packages/sentiment 下载文件并将其放置在
nltk_data/sentiment/vader_lexicon.zip
下。希望这能帮到你一点。
00jrzges2#
很遗憾,我已经尝试过了:/问题是关于Ubuntu或者我想要实现的目标
谢谢你:)