【发布时间】:2016-07-17 16:43:26
【问题描述】:
在我的 Mac 上,安装准系统 NLTK 并输入nltk.download() 工作正常。它给出了一个弹出窗口,并且从那里一帆风顺。
现在我在删除服务器(带有 shell 的 Linux VPS)时遇到问题。我将 nltk 添加到 Python 2 和 Python 3,并从服务器运行 nltk.download()。后者给了我一个复选框的非功能性 ASCII 艺术:
Python 3.4.2 (default, Oct 8 2014, 10:45:20) [GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more
information.
>>> import nltk
>>> nltk.download() NLTK Downloader
---------------------------------------------------------------------------
d) Download l) List u) Update c) Config h) Help q)
Quit
--------------------------------------------------------------------------- Downloader> h
Commands: d) Download a package or collection u) Update out of
date packages l) List packages & collections h) Help c)
View & Modify Configuration q) Quit
---------------------------------------------------------------------------
d) Download l) List u) Update c) Config h) Help q) Quit
--------------------------------------------------------------------------- Downloader> s Command 's' unrecognized
---------------------------------------------------------------------------
d) Download l) List u) Update c) Config h) Help q) Quit
--------------------------------------------------------------------------- Downloader> a Command 'a' unrecognized
---------------------------------------------------------------------------
d) Download l) List u) Update c) Config h) Help q)
Quit
---------------------------------------------------------------------
------ Downloader> d
Download which package (l=list; x=cancel)? Identifier> l Packages:
[ ] abc................. Australian Broadcasting Commission 2006 [ ]
alpino.............. Alpino Dutch Treebank [ ]
averaged_perceptron_tagger Averaged Perceptron Tagger [ ]
basque_grammars..... Grammars for Basque [ ] biocreative_ppi.....
BioCreAtIvE (Critical Assessment of Information
Extraction Systems in Biology) [ ]
bllip_wsj_no_aux.... BLLIP Parser: WSJ Model [ ]
book_grammars....... Grammars from NLTK Book [ ]
brown_tei........... Brown Corpus (TEI XML Version) [ ]
cess_cat............ CESS-CAT Treebank [ ] cess_esp............
CESS-ESP Treebank [ ] chat80.............. Chat-80 Data Files [ ]
city_database....... City Database [ ] cmudict............ The
Carnegie Mellon Pronouncing Dictionary (0.6) [ ]
comparative_sentences Comparative Sentence Dataset [ ]
comtrans............ ComTrans Corpus Sample [ ] conll2000...........
CONLL 2000 Chunking Corpus [ ] conll2002........... CONLL 2002 Named
Entity Recognition Corpus [ ] conll2007........... Dependency
Treebanks from CoNLL 2007 (Catalan
and Basque Subset)
我知道我不需要其他语言;我知道他们中的一些,但只精通部分。
我希望能够使用https://pythonprogramming.net/wordnet-nltk-tutorial/ 中讨论的 NLTK 演示。它使用棕色和可能的其他包装;但我的主要目标的一部分是能够计算单词之间的距离。
【问题讨论】:
-
如果您在本地获取它们,将它们从您的机器上传到服务器会比尝试无头运行下载器更容易吗?此外,我在格式化方面尽了最大努力,但如果您从终端复制并粘贴,然后使用
{}按钮或 Ctrl-K 应用代码块格式,可能会更好。
标签: python python-3.x nltk