我运行nltk测试的服务器不能直接访问位于http://www.nltk.org/nltk_data/
的外部nltk模型,但是我们有一个私有镜像设置来访问nltk模型。在
如何告诉ntlk下载程序从私有镜像安装,而不是从http://www.nltk.org/nltk_data/安装?在
我本以为这会奏效,但没有:
>>> nltk.downloader.Downloader(server_index_url='https://MyNltkMirror/index.xml').download()
NLTK Downloader
---------------------------------------------------------------------------
d) Download l) List u) Update c) Config h) Help q) Quit
---------------------------------------------------------------------------
Downloader> d
Download which package (l=list; x=cancel)?
Identifier> abc
Downloading package abc to /path/to/nltk_data...
Error downloading 'abc' from
<https://raw.githubusercontent.com/nltk/nltk_data/gh-
pages/packages/corpora/abc.zip>: <urlopen error [Errno 104]
Connection reset by peer>
或者,是否有可能是我做得对,并且连接到raw.githubusercontent.com从我的服务器?在
谢谢。在
尝试在不使用交互模式的情况下下载软件包。在
相关问题 更多 >
编程相关推荐