これらのコードを 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__'
何が問題で、これを修正する方法は? ありがとうございました!