Class Bo1
- java.lang.Object
-
- org.terrier.matching.models.queryexpansion.QueryExpansionModel
-
- org.terrier.matching.models.queryexpansion.Bo1
-
public class Bo1 extends QueryExpansionModel
This class implements the Bo1 model for query expansion. See G. Amati's Phd Thesis.- Author:
- Gianni Amati, Ben He
-
-
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
Constructors Constructor Description Bo1()A default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetInfo()Returns the name of the model.doubleparameterFreeNormaliser()This method computes the normaliser of parameter-free query expansion.doubleparameterFreeNormaliser(double maxTermFrequency, double collectionLength, double totalDocumentLength)This method computes the normaliser of parameter-free query expansion.doublescore(double withinDocumentFrequency, double termFrequency)This method implements the query expansion model.doublescore(double withinDocumentFrequency, double termFrequency, double totalDocumentLength, double collectionLength, double averageDocumentLength)This method implements the query expansion model.-
Methods inherited from class org.terrier.matching.models.queryexpansion.QueryExpansionModel
initialise, setAverageDocumentLength, setCollectionLength, setDocumentFrequency, setMaxTermFrequency, setNumberOfDocuments, setTotalDocumentLength
-
-
-
-
Method Detail
-
getInfo
public final java.lang.String getInfo()
Returns the name of the model.- Specified by:
getInfoin classQueryExpansionModel- Returns:
- the name of the model
-
parameterFreeNormaliser
public final double parameterFreeNormaliser()
This method computes the normaliser of parameter-free query expansion.- Specified by:
parameterFreeNormaliserin classQueryExpansionModel- Returns:
- The normaliser.
-
parameterFreeNormaliser
public final double parameterFreeNormaliser(double maxTermFrequency, double collectionLength, double totalDocumentLength)This method computes the normaliser of parameter-free query expansion.- Specified by:
parameterFreeNormaliserin classQueryExpansionModel- Parameters:
maxTermFrequency- The maximum of the term frequency of the query terms.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 query expansion model.- Specified by:
scorein classQueryExpansionModel- 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 the Bose-Einstein dsitribution where the mean is given by the Poisson model.
-
score
public final double score(double withinDocumentFrequency, double termFrequency, double totalDocumentLength, double collectionLength, double averageDocumentLength)This method implements the query expansion model.- Specified by:
scorein classQueryExpansionModel- 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.
-
-