gov.llnl.ontology.wordnet.wsd
Class GraphConnectivityDisambiguation

java.lang.Object
  extended by gov.llnl.ontology.wordnet.wsd.GraphConnectivityDisambiguation
All Implemented Interfaces:
WordSenseDisambiguation
Direct Known Subclasses:
DegreeCentralityDisambiguation, PageRankCentralityDisambiguation

public abstract class GraphConnectivityDisambiguation
extends Object
implements WordSenseDisambiguation

An abstract base class for any of the graph centrality Word Sense Disambiguation algorithms described in the following paper:

This base class extracts a small connected graph from the wordnet heirarchy that is centered around content words in a sentence that needs to be disambiguated. The target sense for each content word will be included in the graph, along with any GraphConnectivityDisambiguation.AnnotationSynsets in the shortest path connecting these target senses. The extracted graph structure for each focus word to be disambiguated will passed to subclasses as an affinity Matrix that records the known edges.

Author:
Keith Stevens

Nested Class Summary
 class GraphConnectivityDisambiguation.AnnotationSynset
          A structure class that represents a Annotation that needs to be disambiguated and it's possible target Synsets.
 
Constructor Summary
GraphConnectivityDisambiguation()
           
 
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(edu.stanford.nlp.pipeline.Annotation annot)
          Returns all of the GraphConnectivityDisambiguation.AnnotationSynsets found given the word and part of speech information, if present, in annot.
protected abstract  void processSentenceGraph(List<GraphConnectivityDisambiguation.AnnotationSynset> targetWords, Set<Synset> synsets, edu.ucla.sspace.basis.StringBasisMapping synsetBasis, edu.ucla.sspace.matrix.Matrix adjacencyMatrix)
          Disambiguates the Annotations in targetWords by using the Set GraphConnectivityDisambiguation.AnnotationSynsets carved out of the ontology for a given setnence.
 void setup(OntologyReader reader)
          Initializes the WordSenseDisambiguation algorithm with the given OntologyReader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphConnectivityDisambiguation

public GraphConnectivityDisambiguation()
Method Detail

processSentenceGraph

protected abstract void processSentenceGraph(List<GraphConnectivityDisambiguation.AnnotationSynset> targetWords,
                                             Set<Synset> synsets,
                                             edu.ucla.sspace.basis.StringBasisMapping synsetBasis,
                                             edu.ucla.sspace.matrix.Matrix adjacencyMatrix)
Disambiguates the Annotations in targetWords by using the Set GraphConnectivityDisambiguation.AnnotationSynsets carved out of the ontology for a given setnence.

Parameters:
targetWords - A list of Annotations and their possible senses that need to be disambiguated. The Annotation in each GraphConnectivityDisambiguation.AnnotationSynset should be updated with the selected word sense.
synsets - The set of GraphConnectivityDisambiguation.AnnotationSynsets to consider for any graph traversal.
synsetBasis - A mapping from GraphConnectivityDisambiguation.AnnotationSynset names to indices in a graph.
adjacencyMatrix - An adjaceny matrix detailing how GraphConnectivityDisambiguation.AnnotationSynsets in synsets are connected.

setup

public void setup(OntologyReader reader)
Initializes the WordSenseDisambiguation algorithm with the given OntologyReader. Any other configuration values should be set via the global system properties object.

Specified by:
setup in interface WordSenseDisambiguation

disambiguate

public Sentence disambiguate(Sentence sentence)
Returns a new List of s which have word sense labels for each noun found in sentences.

Specified by:
disambiguate in interface WordSenseDisambiguation

disambiguate

public 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.

Specified by:
disambiguate in interface WordSenseDisambiguation

getSynsets

protected Synset[] getSynsets(edu.stanford.nlp.pipeline.Annotation annot)
Returns all of the GraphConnectivityDisambiguation.AnnotationSynsets 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.



Copyright © 2010-2011. All Rights Reserved.