public class GoogleSimilarity extends Object implements VectorSimilarity
Modifier and Type | Class and Description |
---|---|
static class |
GoogleSimilarity.Provider |
Constructor and Description |
---|
GoogleSimilarity(int numPages) |
Modifier and Type | Method and Description |
---|---|
double |
getMaxValue() |
double |
getMinValue() |
SRResultList |
mostSimilar(gnu.trove.map.TIntFloatMap query,
int maxResults,
gnu.trove.set.TIntSet validIds)
Returns the most similar items for a particular vector.
|
void |
setMatrices(org.wikibrain.matrix.SparseMatrix features,
org.wikibrain.matrix.SparseMatrix transpose,
File dataDir)
Sets the matrix capturing features and transposes.
|
double |
similarity(org.wikibrain.matrix.MatrixRow a,
org.wikibrain.matrix.MatrixRow b)
Returns the similarity of the two vectors.
|
double |
similarity(gnu.trove.map.TIntFloatMap vector1,
gnu.trove.map.TIntFloatMap vector2)
Computes the similarity between the two vectors.
|
public void setMatrices(org.wikibrain.matrix.SparseMatrix features, org.wikibrain.matrix.SparseMatrix transpose, File dataDir) throws IOException
VectorSimilarity
setMatrices
in interface VectorSimilarity
IOException
public double similarity(gnu.trove.map.TIntFloatMap vector1, gnu.trove.map.TIntFloatMap vector2)
VectorSimilarity
similarity
in interface VectorSimilarity
public double similarity(org.wikibrain.matrix.MatrixRow a, org.wikibrain.matrix.MatrixRow b)
VectorSimilarity
similarity
in interface VectorSimilarity
public SRResultList mostSimilar(gnu.trove.map.TIntFloatMap query, int maxResults, gnu.trove.set.TIntSet validIds) throws IOException
VectorSimilarity
mostSimilar
in interface VectorSimilarity
IOException
public double getMinValue()
getMinValue
in interface VectorSimilarity
public double getMaxValue()
getMaxValue
in interface VectorSimilarity
Copyright © 2014. All rights reserved.