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 SingleFieldModelclone()Clone this weighting modeljava.lang.StringgetInfo()Returns the name of the model.voidprepare()preparedoublescore(double tf, double docLength)This method provides the contract for implementing weighting models.doublescore(Posting _p)Returns scorevoidsetCollectionStatistics(CollectionStatistics _cs)Sets collection statisticsvoidsetEntryStatistics(EntryStatistics _es)Sets entry statistics.voidsetParameter(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:WeightingModelClone this weighting model- Overrides:
clonein classWeightingModel
-
prepare
public void prepare()
Description copied from class:WeightingModelprepare- Overrides:
preparein classWeightingModel
-
score
public double score(Posting _p)
Description copied from class:WeightingModelReturns score- Overrides:
scorein classWeightingModel- Returns:
- score
-
setCollectionStatistics
public void setCollectionStatistics(CollectionStatistics _cs)
Description copied from class:WeightingModelSets collection statistics- Overrides:
setCollectionStatisticsin classWeightingModel
-
setEntryStatistics
public void setEntryStatistics(EntryStatistics _es)
Description copied from class:WeightingModelSets entry statistics.- Overrides:
setEntryStatisticsin classWeightingModel
-
getInfo
public 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 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 c)
Description copied from class:WeightingModelSets the c value- Specified by:
setParameterin interfaceModel- Overrides:
setParameterin classWeightingModel- Parameters:
c- the term frequency normalisation parameter value.
-
-