public class TF_IDF extends WeightingModel
averageDocumentLength, c, cs, documentFrequency, es, i, keyFrequency, numberOfDocuments, numberOfPointers, numberOfTokens, numberOfUniqueTerms, rq, termFrequency
Constructor and Description |
---|
TF_IDF()
A default constructor to make this model.
|
TF_IDF(double _b)
Constructs an instance of TF_IDF
|
Modifier and Type | Method and Description |
---|---|
String |
getInfo()
Returns the name of the model, in this case "TF_IDF"
|
double |
getParameter()
Returns the b parameter to the ranking formula as set by setParameter()
|
double |
score(double tf,
double docLength)
Uses TF_IDF to compute a weight for a term in a document.
|
void |
setParameter(double _b)
Sets the b parameter to ranking formula
|
clone, getOverflowed, prepare, score, setCollectionStatistics, setEntryStatistics, setKeyFrequency, setRequest
public TF_IDF()
public TF_IDF(double _b)
_b
- public final String getInfo()
getInfo
in interface Model
getInfo
in class WeightingModel
public final double score(double tf, double docLength)
score
in class WeightingModel
tf
- The term frequency of the term in the documentdocLength
- the document's lengthpublic void setParameter(double _b)
setParameter
in interface Model
setParameter
in class WeightingModel
_b
- the b parameter value to use.public double getParameter()
getParameter
in interface Model
getParameter
in class WeightingModel
Terrier Information Retrieval Platform 5.1. Copyright © 2004-2019, University of Glasgow