我注意到我不能从nltk.corpus.reader或nltk.corpus导入框架集,并且知道它在新版本的NLTK中是可用的。
$ python
Python 2.7.5+ (default, Sep 19 2013, 13:48:49)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import nltk
>>> nltk.__version__
'3.0a2'但是nltk.downloader为framenet_v15显示了一个条目,而在文件系统中,我有一个目录framnet_v15。那么为什么我不能进口它呢?
>>> from nltk.corpus import framenet
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name framenet
>>> from nltk.corpus.reader import framenet
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name framenet如您所见:框架集语料库已经安装好了。

发布于 2014-01-28 09:21:35
示例
#!/usr/bin/env python
from nltk.corpus.reader import framenet安装
执行
./example.py
https://stackoverflow.com/questions/21401296
复制相似问题