【发布时间】:2013-11-10 17:25:48
【问题描述】:
我在 Ubuntu 13.10 中安装了 python (2.7.5) 和 python-nltk 软件包。运行apt-cache policy python-nltk 返回:
python-nltk:
Installed: 2.0~b9-0ubuntu4
根据Stanford site,2.0+ 应该有stanford 模块。然而,当我尝试导入它时,我收到一个错误:
>>> import nltk.tag.stanford
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named stanford
如何获得斯坦福模块? (最好通过通常的存储库,因为我不喜欢在 Ubuntu 包管理器之外安装软件。)
【问题讨论】:
-
嗨!你看过这个其他相关的问题吗? stackoverflow.com/q/8555312/583834。另外,我刚刚在mac上创建了一个virtualenv,
pip install nltk和import nltk.tag.stanford在没有nltk.download()的情况下工作。话虽如此,我不知道所需文件(即/usr/share/stanford-ner/classifiers/all.3class.distsim.crf.ser.gz和/usr/share/stanford-ner/stanford-ner.jar)在哪里......