pitt.search.semanticvectors
Class VectorSearcher.BalancedVectorSearcherPerm
java.lang.Object
pitt.search.semanticvectors.VectorSearcher
pitt.search.semanticvectors.VectorSearcher.BalancedVectorSearcherPerm
- Enclosing class:
- VectorSearcher
public static class VectorSearcher.BalancedVectorSearcherPerm
- extends VectorSearcher
Class for searching a permuted vector store using cosine similarity.
Uses implementation of rotation for permutation proposed by Sahlgren et al 2008
Should find the term that appears frequently in the position p relative to the
index term (i.e. sat +1 would find a term occurring frequently immediately after "sat"
This is a variant that takes into account differt results obtained when using either
permuted or random index vectors as the cue terms, by taking the mean of the results
obtained with each of these options
Method Summary |
java.util.LinkedList |
getNearestNeighbors(int numResults)
This overides the nearest neighbor class implemented in the abstract
VectorSearcher class |
float |
getScore(float[] testVector)
This needs to be filled in for each subclass. |
float |
getScore2(float[] testVector)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VectorSearcher.BalancedVectorSearcherPerm
public VectorSearcher.BalancedVectorSearcherPerm(VectorStore queryVecStore,
VectorStore searchVecStore,
LuceneUtils luceneUtils,
java.lang.String[] queryTerms)
throws java.lang.IllegalArgumentException,
ZeroVectorException
- Parameters:
queryVecStore
- Vector store to use for query generation (this is also reversed).searchVecStore
- The vector store to search (this is also reversed).luceneUtils
- LuceneUtils object to use for query weighting. (May be null.)queryTerms
- Terms that will be parsed into a query
expression. If the string "?" appears, terms best fitting into this position will be returned
- Throws:
java.lang.IllegalArgumentException
ZeroVectorException
getNearestNeighbors
public java.util.LinkedList getNearestNeighbors(int numResults)
- This overides the nearest neighbor class implemented in the abstract
VectorSearcher class
- Overrides:
getNearestNeighbors
in class VectorSearcher
- Parameters:
numResults
- the number of results / length of the result list.
getScore
public float getScore(float[] testVector)
- Description copied from class:
VectorSearcher
- This needs to be filled in for each subclass. It takes an individual
vector and assigns it a relevance score for this VectorSearcher.
- Specified by:
getScore
in class VectorSearcher
getScore2
public float getScore2(float[] testVector)