Package org.terrier.matching.models
Class SingleFieldModel
- java.lang.Object
-
- org.terrier.matching.models.WeightingModel
-
- org.terrier.matching.models.SingleFieldModel
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,Model
public class SingleFieldModel extends WeightingModel
Use a normal weighting model on a pre-determine subset of the field. Assumes that IDF can be calculated from all fields, but that TFc comes from the specified fields. Usage: trec.model=SingleFieldModel(PL2,2)- 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
-
-
Constructor Summary
Constructors Constructor Description SingleFieldModel(java.lang.String[] parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SingleFieldModel
clone()
Clone this weighting modeljava.lang.String
getInfo()
Returns the name of the model.void
prepare()
preparedouble
score(double tf, double docLength)
This method provides the contract for implementing weighting models.double
score(Posting _p)
Returns scorevoid
setCollectionStatistics(CollectionStatistics _cs)
Sets collection statisticsvoid
setEntryStatistics(EntryStatistics _es)
Sets entry statistics.void
setParameter(double c)
Sets the c value-
Methods inherited from class org.terrier.matching.models.WeightingModel
getOverflowed, getParameter, setKeyFrequency, setRequest
-
-
-
-
Method Detail
-
clone
public SingleFieldModel clone()
Description copied from class:WeightingModel
Clone this weighting model- Overrides:
clone
in classWeightingModel
-
prepare
public void prepare()
Description copied from class:WeightingModel
prepare- Overrides:
prepare
in classWeightingModel
-
score
public double score(Posting _p)
Description copied from class:WeightingModel
Returns score- Overrides:
score
in classWeightingModel
- Returns:
- score
-
setCollectionStatistics
public void setCollectionStatistics(CollectionStatistics _cs)
Description copied from class:WeightingModel
Sets collection statistics- Overrides:
setCollectionStatistics
in classWeightingModel
-
setEntryStatistics
public void setEntryStatistics(EntryStatistics _es)
Description copied from class:WeightingModel
Sets entry statistics.- Overrides:
setEntryStatistics
in classWeightingModel
-
getInfo
public 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 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 c)
Description copied from class:WeightingModel
Sets the c value- Specified by:
setParameter
in interfaceModel
- Overrides:
setParameter
in classWeightingModel
- Parameters:
c
- the term frequency normalisation parameter value.
-
-