gov.llnl.ontology.wordnet.feature
Class SnowEtAlFeatureMaker

java.lang.Object
  extended by gov.llnl.ontology.wordnet.feature.SnowEtAlFeatureMaker
All Implemented Interfaces:
SynsetPairFeatureMaker
Direct Known Subclasses:
ExtendedSnowEtAlFeatureMaker

public class SnowEtAlFeatureMaker
extends Object
implements SynsetPairFeatureMaker

This SynsetPairFeatureMaker creates a subset of the features used by the following paper:

Rion Snow; Sushant Prakash; Daniel Jurafsky; Andrew Y. Ng. "Learning to merge word senses," in Proceedings of the 2007 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning

This class uses only features that are based on the path's linking two Synsets. This is done because Synsets that are automatically added to WordNet are likely to be missing information content, glosses, and links besides Hypernymy and Hyponymy.

The feature vectors generated by this class can be used to train a classifier, if a predetermined clustering for all Sysnets can be provided. When creating a set of test feature vectors, this set of assignments does not need to be provided.

Classes which want to use a superset of these features can extends this class and implement three helper methods.

Author:
Keith Stevens

Constructor Summary
SnowEtAlFeatureMaker(OntologyReader wordnet)
          Creates a new SnowEtAlFeatureMaker.
SnowEtAlFeatureMaker(OntologyReader wordnet, String mergedInfoFilename)
          Creates a new SnowEtAlFeatureMaker.
 
Method Summary
protected  void addExtraAttributes(List<String> attributeList)
          Appends extra attribute labels.
protected  void addExtraFeatures(Synset sense1, Synset sense2, edu.ucla.sspace.vector.DoubleVector featureVector, int index)
          Adds extra feature values to featureVector.
 List<String> makeAttributeList()
          Returns a list of attribute labels.
 edu.ucla.sspace.vector.DoubleVector makeFeatureVector(Synset sense1, Synset sense2)
          Returns a feature vector that specifies how similar synset1 is to synset2 according to a variety of measures.
protected  int numExtraFeatures()
          Returns the number of extra features.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SnowEtAlFeatureMaker

public SnowEtAlFeatureMaker(OntologyReader wordnet)
Creates a new SnowEtAlFeatureMaker. No sense clustering is used.


SnowEtAlFeatureMaker

public SnowEtAlFeatureMaker(OntologyReader wordnet,
                            String mergedInfoFilename)
Creates a new SnowEtAlFeatureMaker. If mergedInfoFilename is not null, the cluster assignments are used as class labels.

Method Detail

numExtraFeatures

protected int numExtraFeatures()
Returns the number of extra features.


addExtraAttributes

protected void addExtraAttributes(List<String> attributeList)
Appends extra attribute labels.


addExtraFeatures

protected void addExtraFeatures(Synset sense1,
                                Synset sense2,
                                edu.ucla.sspace.vector.DoubleVector featureVector,
                                int index)
Adds extra feature values to featureVector. index is the first index at which a feature can be stored.


makeAttributeList

public List<String> makeAttributeList()
Returns a list of attribute labels. This list must have the same length as the feature vector generated for every Synset pair.

Specified by:
makeAttributeList in interface SynsetPairFeatureMaker

makeFeatureVector

public edu.ucla.sspace.vector.DoubleVector makeFeatureVector(Synset sense1,
                                                             Synset sense2)
Returns a feature vector that specifies how similar synset1 is to synset2 according to a variety of measures.

Specified by:
makeFeatureVector in interface SynsetPairFeatureMaker

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010-2011. All Rights Reserved.