TypeError:' instancemethod'对象没有属性' __ getitem __'与NLTK

时间:2016-03-26 11:01:16

标签: python nlp nltk wordnet lemmatization

我试图用NLTK运行这些代码:

>>> gn2 = wordnet.synset('good.n.02')
>>> gn2.definition
'moral excellence or admirableness'
>>> evil = gn2.lemmas[0].antonyms()[0]

结果出现了错误:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'instancemethod' object has no attribute '__getitem__'

有什么问题以及如何解决这个问题?谢谢!

0 个答案:

没有答案