Package org.terrier.matching.models
Class Dl
- java.lang.Object
-
- org.terrier.matching.models.WeightingModel
-
- org.terrier.matching.models.Dl
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,Model
public class Dl extends WeightingModel
This class implements a simple document length 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.String
getInfo()
Returns the name of the model.double
getParameter()
Returns the b parameter to the ranking formula as set by setParameter()double
score(double tf, double docLength)
This method provides the contract for implementing weighting models.void
setParameter(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:WeightingModel
Returns the name of the model.- Specified by:
getInfo
in interfaceModel
- Specified by:
getInfo
in classWeightingModel
- Returns:
- java.lang.String
-
score
public final double score(double tf, double docLength)
Description copied from class:WeightingModel
This method provides the contract for implementing weighting models.- Specified by:
score
in 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:
setParameter
in interfaceModel
- Overrides:
setParameter
in 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:
getParameter
in interfaceModel
- Overrides:
getParameter
in classWeightingModel
-
-