我正在使用此代码查找单词的所有上位词
from nltk import wordnet as wn
for synset in wn.wordnet.synsets('green'):
for hypernym in synset.hypernyms():
print synset, hypernym
Run Code Online (Sandbox Code Playgroud)
但这给出了错误:
File"<stdin>",line 1 in <module>
File "/usr/local/lib/python 2.7/dist-packages/nltk/corpus/reader/wordnet.py"line 1219 in synset
lema,pos,synset_index_str=name.lower().rsplit('.',2)
ValueError: need more than 1 value to unpack
Run Code Online (Sandbox Code Playgroud)
你能建议点什么吗