用python 对下面两个句子中的“bank”进行语义消歧,找出每个句子中的“bank”对应到WordNet中的哪一个语义。初学者求指教
l The bank will not be accepting cash on Saturdays.
l The river overflowed the bank.
你可以参考一下这个 Word sense disambiguation in NLTK Python
查看 alvas 这个用户的回答
//...
>>> from nltk.wsd import lesk
>>> sent = 'I went to the bank to deposit my money'
>>> ambiguous = 'bank'
>>> lesk(sent, ambiguous)
Synset('bank.v.04')
>>> lesk(sent, ambiguous).definition()
u'act as the banker in a game or in gambling'
//...