如何在jupyter中通过NLTK下载vader_lexicon

时间:2017-11-03 20:14:59

标签: python nltk jupyter

我知道我可以使用:

nltk.download()

但我真的不想浪费时间让整个事情下载。我如何安装vader_lexicon

2 个答案:

答案 0 :(得分:0)

您可以在命令提示符/终端

中尝试以下命令
python -m nltk.downloader vader_lexicon

Windows的输出:

[nltk_data] Downloading package vader_lexicon to
[nltk_data]     C:\Users\username\AppData\Roaming\nltk_data...

它只会将特定包下载到nltk_data文件夹。

答案 1 :(得分:0)

使用带有/不带Jupyter的Python中的nltk.download()

>>> import nltk
>>> nltk.download('vader_lexicon')
[nltk_data] Downloading package vader_lexicon to
[nltk_data]     /Users/liling.tan/nltk_data...
[nltk_data]   Package vader_lexicon is already up-to-date!
True

或在终端上:

$ python -m nltk.downloader vader_lexicon
[nltk_data] Downloading package vader_lexicon to
[nltk_data]     /Users/liling.tan/nltk_data...
[nltk_data]   Package vader_lexicon is already up-to-date!