gov.llnl.ontology.clustering
Class LocalitySensitiveWordSpaceClustering

java.lang.Object
  extended by gov.llnl.ontology.clustering.LocalitySensitiveWordSpaceClustering
All Implemented Interfaces:
ClusterSimilarity, Serializable

public class LocalitySensitiveWordSpaceClustering
extends Object
implements ClusterSimilarity, Serializable

This class creates a soft cluster for a subset of the words in a word space based on the similarity lists generated. This class can be serialized and deserialized easily so that other codes can retrieve the similarity values.

Author:
Keith Stevens
See Also:
Serialized Form

Constructor Summary
LocalitySensitiveWordSpaceClustering(edu.ucla.sspace.common.SemanticSpace sspace, int numClusters, int numBasisVectors, int numPermutations, int numNeighbors, double threshold)
          Creates a new LocalitySensitiveWordSpaceClustering by generating similarity lists with a LocalitySensitiveSimilarityListGenerator and then saving only a small portion of those similarity lists.
 
Method Summary
 double getTermSimilarity(String term1, String term2)
          Returns the similarity between term1 and term2.
static void main(String[] args)
           
 String toString()
          Returns "lsh_" + the name of the sspace algorithm used to generate the cluster assignments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalitySensitiveWordSpaceClustering

public LocalitySensitiveWordSpaceClustering(edu.ucla.sspace.common.SemanticSpace sspace,
                                            int numClusters,
                                            int numBasisVectors,
                                            int numPermutations,
                                            int numNeighbors,
                                            double threshold)
Creates a new LocalitySensitiveWordSpaceClustering by generating similarity lists with a LocalitySensitiveSimilarityListGenerator and then saving only a small portion of those similarity lists. Similarity lists that are maintained become clusters, and each word in the remaining word space can be placed in several clusters.

Method Detail

main

public static void main(String[] args)

getTermSimilarity

public double getTermSimilarity(String term1,
                                String term2)
Returns the similarity between term1 and term2. If both terms are in the same cluster, their similarity is the minimum similarity of the cosine similarity for each term to the clusters centroid, otherwise it is 0.

Specified by:
getTermSimilarity in interface ClusterSimilarity

toString

public String toString()
Returns "lsh_" + the name of the sspace algorithm used to generate the cluster assignments.

Overrides:
toString in class Object


Copyright © 2010-2011. All Rights Reserved.