|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.llnl.ontology.wordnet.wsd.SlidingWindowDisambiguation
public abstract class SlidingWindowDisambiguation
An abstract WordSenseDisambiguation implementation that uses a
sliding window of text over the document. The focus word in each window will
be disambiguated if it is for a noun, and the word is found in WordNet,
otherwise the focus word will be ignored. Subclasses should implement processContext to handle each sliding window context and update the focus
word Annotation with a word sense tag.
| Constructor Summary | |
|---|---|
SlidingWindowDisambiguation()
|
|
| Method Summary | |
|---|---|
Sentence |
disambiguate(Sentence sentence)
Returns a new List of s which have word sense
labels for each noun found in sentences. |
Sentence |
disambiguate(Sentence sentence,
Set<Integer> focusIndices)
Returns a new List of Sentences which have word sense
labels for each annotation index stored in targetWords. |
protected Synset[] |
getSynsets(OntologyReader reader,
edu.stanford.nlp.pipeline.Annotation annot)
Returns all of the Synsets found given the word and part of
speech information, if present, in annot. |
protected abstract void |
processContext(edu.stanford.nlp.pipeline.Annotation focus,
edu.stanford.nlp.pipeline.Annotation result,
Queue<edu.stanford.nlp.pipeline.Annotation> prevWords,
Queue<edu.stanford.nlp.pipeline.Annotation> nextWords)
Processes the local context surrounded focus. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface gov.llnl.ontology.wordnet.wsd.WordSenseDisambiguation |
|---|
setup |
| Constructor Detail |
|---|
public SlidingWindowDisambiguation()
| Method Detail |
|---|
protected abstract void processContext(edu.stanford.nlp.pipeline.Annotation focus,
edu.stanford.nlp.pipeline.Annotation result,
Queue<edu.stanford.nlp.pipeline.Annotation> prevWords,
Queue<edu.stanford.nlp.pipeline.Annotation> nextWords)
focus. This should update
focus with any word sense disambiguation Annotations
discovered.
focus - The Annotation to disambiguate.prevWords - The N Annotation words before focus.nextWords - The N Annotation words after focus.public Sentence disambiguate(Sentence sentence)
List of s which have word sense
labels for each noun found in sentences.
disambiguate in interface WordSenseDisambiguation
public Sentence disambiguate(Sentence sentence,
Set<Integer> focusIndices)
List of Sentences which have word sense
labels for each annotation index stored in targetWords.
disambiguate in interface WordSenseDisambiguation
protected Synset[] getSynsets(OntologyReader reader,
edu.stanford.nlp.pipeline.Annotation annot)
Synsets found given the word and part of
speech information, if present, in annot. If the part of speech
is available, but provides no synsets, all possible synsets are returned
for the word, under the assumption that the tag may be incorrect.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||