Class BM
- java.lang.Object
-
- org.terrier.matching.models.basicmodel.BasicModel
-
- org.terrier.matching.models.basicmodel.BM
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class BM extends BasicModel
This class implements the BM weighting model, which generates the original weight given by the BM25 formula, without frequency normalisation and query term weighting. Feel free to combine the BM model with any frequency normalisation method. However, it is NOT recommended to use BM with the first normalisation for after effect. For example, to use the BM model with the normalisation 2, add the following line in file etc/trec.models: DFRWeightingModel(BM, , 2) Leave the space between the comas blank so that the first normalisation is disabled.- Author:
- Ben He
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringmodelNameThe name of the model.-
Fields inherited from class org.terrier.matching.models.basicmodel.BasicModel
i, numberOfDocuments, numberOfTokens
-
-
Constructor Summary
Constructors Constructor Description BM()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.doublescore(double tf, double documentFrequency, double termFrequency, double keyFrequency, double documentLength)This method computes the score for the implemented weighting model.-
Methods inherited from class org.terrier.matching.models.basicmodel.BasicModel
clone, setNumberOfDocuments, setNumberOfTokens, stirlingPower
-
-
-
-
Method Detail
-
getInfo
public java.lang.String getInfo()
Returns the name of the model.- Specified by:
getInfoin classBasicModel- Returns:
- the name of the model
-
score
public double score(double tf, double documentFrequency, double termFrequency, double keyFrequency, double documentLength)This method computes the score for the implemented weighting model.- Specified by:
scorein classBasicModel- Parameters:
tf- The term frequency in the documentdocumentFrequency- The document frequency of the termtermFrequency- the term frequency in the collectionkeyFrequency- The normalised query term frequency.documentLength- The length of the document.- Returns:
- the score returned by the implemented weighting model.
-
-