Package org.terrier.matching.models
Class Tf
- java.lang.Object
-
- org.terrier.matching.models.WeightingModel
-
- org.terrier.matching.models.Tf
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,Model
public class Tf extends WeightingModel
This class implements a simple Tf weighting model.- Since:
- 4.0
- Author:
- Craig Macdonald
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.terrier.matching.models.WeightingModel
averageDocumentLength, c, cs, documentFrequency, es, i, keyFrequency, numberOfDocuments, numberOfPointers, numberOfPostings, numberOfTokens, numberOfUniqueTerms, rq, termFrequency
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetInfo()Returns the name of the model.doublegetParameter()Returns the b parameter to the ranking formula as set by setParameter()doublescore(double tf, double docLength)This method provides the contract for implementing weighting models.voidsetParameter(double b)Sets the b parameter to ranking formula-
Methods inherited from class org.terrier.matching.models.WeightingModel
clone, getOverflowed, prepare, score, setCollectionStatistics, setEntryStatistics, setKeyFrequency, setRequest
-
-
-
-
Method Detail
-
getInfo
public final java.lang.String getInfo()
Description copied from class:WeightingModelReturns the name of the model.- Specified by:
getInfoin interfaceModel- Specified by:
getInfoin classWeightingModel- Returns:
- java.lang.String
-
score
public final double score(double tf, double docLength)Description copied from class:WeightingModelThis method provides the contract for implementing weighting models.- Specified by:
scorein classWeightingModel- Parameters:
tf- The term frequency in the documentdocLength- the document's length- Returns:
- the score assigned to a document with the given tf and docLength, and other preset parameters
-
setParameter
public void setParameter(double b)
Sets the b parameter to ranking formula- Specified by:
setParameterin interfaceModel- Overrides:
setParameterin classWeightingModel- Parameters:
b- the b parameter value to use.
-
getParameter
public double getParameter()
Returns the b parameter to the ranking formula as set by setParameter()- Specified by:
getParameterin interfaceModel- Overrides:
getParameterin classWeightingModel
-
-