Closed deepak8888 closed 5 years ago
@deepak8888 sorry there was some weird bugs upstream in the wordnet reader.
Please upgrade your pywsd version.
pip install -U pywsd
(Note: the new version only supports Python 3)
With the new version, pywsd>=1.2.0
:
>>> from pywsd import disambiguate
>>> from pywsd.similarity import max_similarity as maxsim
>>> disambiguate('I went to the bank to deposit my money')
[('I', None), ('went', Synset('run_low.v.01')), ('to', None), ('the', None),
('bank', Synset('depository_financial_institution.n.01')), ('to', None),
('deposit', Synset('deposit.v.02')), ('my', None), ('money', Synset('money.n.03'))]
Maxsimiliarity Algorithm is not giving correct results. Results Obtained:
Expected Result:
[('I', 'i', None), ('went', u'go', Synset('sound.v.02')), ('to', 'to', None), ('the', 'the', None), ('bank', 'bank', Synset('bank.n.06')), ('to', 'to', None), ('deposit', 'deposit', Synset('deposit.v.02')), ('my', 'my', None), ('money', 'money', Synset('money.n.01'))]
It is not disambiguating nouns.