org.terrier.matching.models.queryexpansion
Class KLComplete

java.lang.Object
  extended by org.terrier.matching.models.queryexpansion.QueryExpansionModel
      extended by org.terrier.matching.models.queryexpansion.KLComplete

public class KLComplete
extends QueryExpansionModel

This class implements the complete Kullback-Leibler divergence for query expansion. See the equation after (8.12) for query expansion, page 149.

Author:
Gianni Amati, Ben He, Vassilis Plachouras

Field Summary
 
Fields inherited from class org.terrier.matching.models.queryexpansion.QueryExpansionModel
averageDocumentLength, collectionLength, documentFrequency, EXPANSION_DOCUMENTS, EXPANSION_TERMS, idf, maxTermFrequency, numberOfDocuments, PARAMETER_FREE, ROCCHIO_BETA, totalDocumentLength
 
Constructor Summary
KLComplete()
          A default constructor.
 
Method Summary
 java.lang.String getInfo()
          Returns the name of the model.
 double parameterFreeNormaliser()
          This method provides the contract for computing the normaliser of parameter-free query expansion.
 double parameterFreeNormaliser(double maxTermFrequency, double collectionLength, double totalDocumentLength)
          This method provides the contract for computing the normaliser of parameter-free query expansion.
 double score(double withinDocumentFrequency, double termFrequency)
          This method implements the complete Kullback-Leibler divergence for query expansion.
 double score(double withinDocumentFrequency, double termFrequency, double totalDocumentLength, double collectionLength, double averageDocumentLength)
          This method provides the contract for implementing query expansion models.
 
Methods inherited from class org.terrier.matching.models.queryexpansion.QueryExpansionModel
initialise, setAverageDocumentLength, setCollectionLength, setDocumentFrequency, setMaxTermFrequency, setNumberOfDocuments, setTotalDocumentLength
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KLComplete

public KLComplete()
A default constructor.

Method Detail

getInfo

public final java.lang.String getInfo()
Returns the name of the model.

Specified by:
getInfo in class QueryExpansionModel
Returns:
the name of the model

parameterFreeNormaliser

public final double parameterFreeNormaliser()
This method provides the contract for computing the normaliser of parameter-free query expansion.

Specified by:
parameterFreeNormaliser in class QueryExpansionModel
Returns:
The normaliser.

parameterFreeNormaliser

public final double parameterFreeNormaliser(double maxTermFrequency,
                                            double collectionLength,
                                            double totalDocumentLength)
This method provides the contract for computing the normaliser of parameter-free query expansion.

Specified by:
parameterFreeNormaliser in class QueryExpansionModel
Parameters:
maxTermFrequency - The maximum of the in-collection term frequency of the terms in the pseudo relevance set.
collectionLength - The number of tokens in the collections.
totalDocumentLength - The sum of the length of the top-ranked documents.
Returns:
The normaliser.

score

public final double score(double withinDocumentFrequency,
                          double termFrequency)
This method implements the complete Kullback-Leibler divergence for query expansion. See the equation after (8.12) for query expansion, page 149.

Specified by:
score in class QueryExpansionModel
Parameters:
withinDocumentFrequency - double The term frequency in the X top-retrieved documents.
termFrequency - double The term frequency in the collection.
Returns:
double The query expansion weight using he complete Kullback-Leibler divergence.

score

public final double score(double withinDocumentFrequency,
                          double termFrequency,
                          double totalDocumentLength,
                          double collectionLength,
                          double averageDocumentLength)
This method provides the contract for implementing query expansion models. For some models, we have to set the beta and the documentFrequency of a term.

Specified by:
score in class QueryExpansionModel
Parameters:
withinDocumentFrequency - double The term frequency in the X top-retrieved documents.
termFrequency - double The term frequency in the collection.
totalDocumentLength - double The sum of length of the X top-retrieved documents.
collectionLength - double The number of tokens in the whole collection.
averageDocumentLength - double The average document length in the collection.
Returns:
double The score returned by the implemented model.


Terrier 3.5. Copyright © 2004-2011 University of Glasgow