You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Love the tool! Super helpful. However, it bugs out if you try to run the maxsim disambiguation on a sentence where the wn.sysnet pos doesn't match the NLTK tagged pos.
Try running
sen = 'these potato chips are great'
disambiguate(sen, algorithm=maxsim)
and you get an index out of range error because result in max_similarity in similarity.py is [], because wn.synsets(ambiguous_word, pos=pos) is nothing as NLTK has (incorrectly) decided the part of speach of 'Potato' is an adjective, and there's no synset for that.
A very simple fix- change line 114 from
for i in wn.synsets(ambiguous_word, pos=pos):
to
for i in wn.synsets(ambiguous_word, pos=pos) or wn.synsets(ambiguous_word):
to provide a fallback option
The text was updated successfully, but these errors were encountered:
Love the tool! Super helpful. However, it bugs out if you try to run the maxsim disambiguation on a sentence where the wn.sysnet pos doesn't match the NLTK tagged pos.
Try running
and you get an index out of range error because
result
inmax_similarity
in similarity.py is[]
, becausewn.synsets(ambiguous_word, pos=pos)
is nothing as NLTK has (incorrectly) decided the part of speach of 'Potato' is an adjective, and there's no synset for that.A very simple fix- change line 114 from
for i in wn.synsets(ambiguous_word, pos=pos):
to
for i in wn.synsets(ambiguous_word, pos=pos) or wn.synsets(ambiguous_word):
to provide a fallback option
The text was updated successfully, but these errors were encountered: