|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.gla.terrier.matching.models.WeightingModel
public abstract class WeightingModel
This class should be extended by the classes used for weighting terms and documents.
Constructor Summary | |
---|---|
WeightingModel()
A default constructor that initialises the idf i attribute |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clone this weighting model |
abstract java.lang.String |
getInfo()
Returns the name of the model. |
double |
getParameter()
Returns the parameter as set by setParameter() |
abstract double |
score(double tf,
double docLength)
This method provides the contract for implementing weighting models. |
abstract double |
score(double tf,
double docLength,
double n_t,
double F_t,
double keyFrequency)
This method provides the contract for implementing weighting models. |
void |
setAverageDocumentLength(double avgDocLength)
Sets the average length of documents in the collection. |
void |
setDocumentFrequency(double docFreq)
Sets the document frequency of the term in the collection. |
void |
setKeyFrequency(double keyFreq)
Sets the term's frequency in the query. |
void |
setNumberOfDocuments(double numOfDocs)
Sets the number of documents in the collection. |
void |
setNumberOfPointers(double number)
Set the number of pointers in the collection. |
void |
setNumberOfTokens(double value)
Set the number of tokens in the collection. |
void |
setNumberOfUniqueTerms(double number)
Set the number of unique terms in the collection. |
void |
setParameter(double c)
Sets the c value |
void |
setTermFrequency(double termFreq)
Sets the term's frequency in the collection. |
double |
stirlingPower(double n,
double m)
This method provides the contract for implementing the Stirling formula for the power series. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WeightingModel()
Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public abstract java.lang.String getInfo()
getInfo
in interface Model
public abstract double score(double tf, double docLength)
tf
- The term frequency in the documentdocLength
- the document's length
public abstract double score(double tf, double docLength, double n_t, double F_t, double keyFrequency)
tf
- The term frequency in the documentdocLength
- the document's lengthn_t
- The document frequency of the termF_t
- the term frequency in the collectionkeyFrequency
- the term frequency in the query
public void setAverageDocumentLength(double avgDocLength)
setAverageDocumentLength
in interface Model
avgDocLength
- The documents' average length.public void setParameter(double c)
setParameter
in interface Model
c
- the term frequency normalisation parameter value.public double getParameter()
getParameter
in interface Model
public void setDocumentFrequency(double docFreq)
docFreq
- the document frequency of the term in the collection.public void setKeyFrequency(double keyFreq)
keyFreq
- the term's frequency in the query.public void setNumberOfTokens(double value)
setNumberOfTokens
in interface Model
value
- The number of tokens in the collection.public void setNumberOfDocuments(double numOfDocs)
setNumberOfDocuments
in interface Model
numOfDocs
- the number of documents in the collection.public void setTermFrequency(double termFreq)
termFreq
- the term's frequency in the collection.public void setNumberOfUniqueTerms(double number)
setNumberOfUniqueTerms
in interface Model
number
- double The number of unique terms in the collection.public void setNumberOfPointers(double number)
setNumberOfPointers
in interface Model
public double stirlingPower(double n, double m)
n
- The parameter of the Stirling formula.m
- The parameter of the Stirling formula.
|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |