Files
old-nlp/venv/lib/python3.7/site-packages/nltk/__pycache__/wsd.cpython-37.pyc

27 lines
1.7 KiB
Plaintext
Raw Normal View History

2019-10-20 13:16:49 +02:00
B
D(<28>]<5D><00>@sddlmZddd<04>ZdS)<06>)<01>wordnetNcsVt|<00><01>|dkrt<01>|<01>}<03>r0<72>fdd<03>|D<00>}|s8dSt<03>fdd<05>|D<00><01>\}}|S)a<>Return a synset for an ambiguous word in a context.
:param iter context_sentence: The context sentence where the ambiguous word
occurs, passed as an iterable of words.
:param str ambiguous_word: The ambiguous word that requires WSD.
:param str pos: A specified Part-of-Speech (POS).
:param iter synsets: Possible synsets of the ambiguous word.
:return: ``lesk_sense`` The Synset() object with the highest signature overlaps.
This function is an implementation of the original Lesk algorithm (1986) [1].
Usage example::
>>> lesk(['I', 'went', 'to', 'the', 'bank', 'to', 'deposit', 'money', '.'], 'bank', 'n')
Synset('savings_bank.n.02')
[1] Lesk, Michael. "Automatic sense disambiguation using machine
readable dictionaries: how to tell a pine cone from an ice cream
cone." Proceedings of the 5th Annual International Conference on
Systems Documentation. ACM, 1986.
http://dl.acm.org/citation.cfm?id=318728
Ncs g|]}t|<01><01><00><01>kr|<01>qS<00>)<02>str<74>pos)<02>.0<EFBFBD>ss)rr<00>*/tmp/pip-install-4m6m_5d_/nltk/nltk/wsd.py<70>
<listcomp>*szlesk.<locals>.<listcomp>c3s(|] }t<00><00>|<01><02><00><03><00><01>|fVqdS)N)<04>len<65> intersectionZ
definition<EFBFBD>split)rr)<01>contextrr<00> <genexpr>0szlesk.<locals>.<genexpr>)<04>setr<00>synsets<74>max)Zcontext_sentenceZambiguous_wordrr<00>_Zsenser)r rr<00>lesk s
r)NN)Z nltk.corpusrrrrrr<00><module>
s