public abstract class WeightingModel extends Object implements Model, Serializable, Cloneable
Modifier and Type | Field and Description |
---|---|
protected double |
averageDocumentLength
The average length of documents in the collection.
|
protected double |
c
The parameter c.
|
protected CollectionStatistics |
cs |
protected double |
documentFrequency
The document frequency of the term in the collection.
|
protected EntryStatistics |
es |
protected Idf |
i
The class used for computing the idf values.
|
protected double |
keyFrequency
The term frequency in the query.
|
protected double |
numberOfDocuments
The number of documents in the collection.
|
protected double |
numberOfPointers
The number of distinct entries in the inverted file.
|
protected double |
numberOfTokens
The number of tokens in the collections.
|
protected double |
numberOfUniqueTerms
Number of unique terms in the collection
|
protected Request |
rq |
protected double |
termFrequency
The term frequency in the collection.
|
Constructor and Description |
---|
WeightingModel()
A default constructor that initialises the idf i attribute
|
Modifier and Type | Method and Description |
---|---|
WeightingModel |
clone()
Clone this weighting model
|
abstract String |
getInfo()
Returns the name of the model.
|
static long |
getOverflowed(int o)
Returns overflow
|
double |
getParameter()
Returns the parameter as set by setParameter()
|
void |
prepare()
prepare
|
abstract double |
score(double tf,
double docLength)
This method provides the contract for implementing weighting models.
|
double |
score(Posting p)
Returns score
|
void |
setCollectionStatistics(CollectionStatistics _cs)
Sets collection statistics
|
void |
setEntryStatistics(EntryStatistics _es)
Sets entry statistics.
|
void |
setKeyFrequency(double keyFreq)
Sets the term's frequency in the query.
|
void |
setParameter(double _c)
Sets the c value
|
void |
setRequest(Request _rq)
Sets request
|
protected Idf i
protected double averageDocumentLength
protected double keyFrequency
protected double documentFrequency
protected double termFrequency
protected double numberOfDocuments
protected double numberOfTokens
protected double c
protected double numberOfUniqueTerms
protected double numberOfPointers
protected CollectionStatistics cs
protected EntryStatistics es
protected Request rq
public WeightingModel()
public WeightingModel clone()
public abstract String getInfo()
public void prepare()
public static long getOverflowed(int o)
o
- public double score(Posting p)
p
- public void setCollectionStatistics(CollectionStatistics _cs)
_cs
- public void setEntryStatistics(EntryStatistics _es)
_es
- public void setRequest(Request _rq)
_rq
- public abstract double score(double tf, double docLength)
tf
- The term frequency in the documentdocLength
- the document's lengthpublic void setParameter(double _c)
setParameter
in interface Model
_c
- the term frequency normalisation parameter value.public double getParameter()
getParameter
in interface Model
public void setKeyFrequency(double keyFreq)
keyFreq
- the term's frequency in the query.Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow