Commit 701f8ea1 by Steven Bird

fix typos, credit authorship

parent 481a8cec
# Natural Language Toolkit: Word Sense Disambiguation Algorithms # Natural Language Toolkit: Word Sense Disambiguation Algorithms
# #
# Author: Liling Tan <alvations@gmail.com> # Authors: Liling Tan <alvations@gmail.com>,
# Dmitrijs Milajevs <dimazest@gmail.com>
# #
# Copyright (C) 2001-2014 NLTK Project # Copyright (C) 2001-2014 NLTK Project
# URL: <http://nltk.org/> # URL: <http://nltk.org/>
...@@ -15,7 +16,7 @@ def lesk(context_sentence, ambiguous_word, pos=None, synsets=None): ...@@ -15,7 +16,7 @@ def lesk(context_sentence, ambiguous_word, pos=None, synsets=None):
:param context_sentence: The context sentence where the ambiguous word occurs. :param context_sentence: The context sentence where the ambiguous word occurs.
:param ambiguous_word: The ambiguous word that requires WSD. :param ambiguous_word: The ambiguous word that requires WSD.
:param pos: A specified Part-of-Speech (POS). :param pos: A specified Part-of-Speech (POS).
:param iter sysnsets: Possible synsets of the ambiguous word. :param iter synsets: Possible synsets of the ambiguous word.
:return: ``lesk_sense`` The Synset() object with the highest signature overlaps. :return: ``lesk_sense`` The Synset() object with the highest signature overlaps.
This function is an implementation of the original Lesk algorithm (1986) [1]. This function is an implementation of the original Lesk algorithm (1986) [1].
...@@ -25,12 +26,13 @@ def lesk(context_sentence, ambiguous_word, pos=None, synsets=None): ...@@ -25,12 +26,13 @@ def lesk(context_sentence, ambiguous_word, pos=None, synsets=None):
>>> lesk(['I', 'went', 'to', 'the', 'bank', 'to', 'deposit', 'money', '.'], 'bank', 'n') >>> lesk(['I', 'went', 'to', 'the', 'bank', 'to', 'deposit', 'money', '.'], 'bank', 'n')
Synset('savings_bank.n.02') Synset('savings_bank.n.02')
[1] Lesk, Michael. "Automatic sense disambiguation using machine readable [1] Lesk, Michael. "Automatic sense disambiguation using machine
dictionaries: how to tell a pine cone from an ice cream cone." Proceedings readable dictionaries: how to tell a pine cone from an ice cream
of the 5th annual international conference on Systems documentation. ACM, cone." Proceedings of the 5th Annual International Conference on
1986. http://dl.acm.org/citation.cfm?id=318728 Systems Documentation. ACM, 1986.
http://dl.acm.org/citation.cfm?id=318728
""" """
context = set(context_sentence) context = set(context_sentence)
if not synsets: if not synsets:
synsets = wordnet.synsets(ambiguous_word) synsets = wordnet.synsets(ambiguous_word)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment