vendredi 8 juillet 2016

How to get Sense Key in WordNet for NLTK Python?

Hi Stackoverflow Community

I just started tinkering around with Python NLTK and have directed my attention to the Wordnet module.

I am attempting to get the Sense Ky for a given lemma and found the following:

s = wn.synset('skill.n.01')
s.lemmas # >>> [Lemma('skill.n.01.skill'), ... ]
s.lemmas[0].key # >>> 'skill%1:09:01::'

However, this implementation doesn't seem to be supported anymore.

Traceback (most recent call last):
File "C:/Users/Admin/PycharmProjects/momely/placementarchitect/testbench.py", line 59, in <module>
s.lemmas[0].key
TypeError: 'method' object is not subscriptable

I am wondering whether anyone would be able to point me in the right direction as to how I might be able to get the sense key given a lemma or synset?

Any advice would be highly appreciated!

Aucun commentaire:

Enregistrer un commentaire