|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terrier.matching.models.WeightingModel
public abstract class WeightingModel
This class should be extended by the classes used for weighting terms and documents.
| Field Summary | |
|---|---|
protected double |
averageDocumentLength
The average length of documents in the collection. |
protected double |
c
The parameter c. |
protected double |
documentFrequency
The document frequency of the term in the collection. |
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 double |
termFrequency
The term frequency in the collection. |
| 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. |
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. |
abstract double |
score(double tf,
double docLength,
double n_t,
double F_t,
double _keyFrequency)
This method provides the contract for implementing weighting models. |
double |
score(Posting p)
Returns score |
void |
setAverageDocumentLength(double avgDocLength)
Deprecated. Use setCollectionStatistics(CollectionStatistics) |
void |
setCollectionStatistics(CollectionStatistics _cs)
Sets collection statistics |
void |
setDocumentFrequency(double docFreq)
Deprecated. Use setEntryStatistics(EntryStatistics) |
void |
setEntryStatistics(EntryStatistics _es)
Sets entry statistics. |
void |
setKeyFrequency(double keyFreq)
Sets the term's frequency in the query. |
void |
setNumberOfDocuments(double numOfDocs)
Deprecated. Use setCollectionStatistics(CollectionStatistics) |
void |
setNumberOfPointers(double number)
Deprecated. Use setCollectionStatistics(CollectionStatistics) |
void |
setNumberOfTokens(double value)
Deprecated. Use setCollectionStatistics(CollectionStatistics) |
void |
setNumberOfUniqueTerms(double number)
Deprecated. Use setCollectionStatistics(CollectionStatistics) |
void |
setParameter(double _c)
Sets the c value |
void |
setRequest(Request _rq)
Sets request |
void |
setTermFrequency(double termFreq)
Deprecated. Use setEntryStatistics(EntryStatistics) |
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public WeightingModel()
| Method Detail |
|---|
public java.lang.Object clone()
clone in class java.lang.Objectpublic abstract java.lang.String getInfo()
getInfo in interface Modelpublic 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 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 collection_keyFrequency - the term frequency in the query
public void setAverageDocumentLength(double avgDocLength)
setAverageDocumentLength in interface ModelavgDocLength - 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 Modelpublic 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 Modelvalue - The number of tokens in the collection.public void setNumberOfDocuments(double numOfDocs)
setNumberOfDocuments in interface ModelnumOfDocs - 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 Modelnumber - double The number of unique terms in the collection.public void setNumberOfPointers(double number)
setNumberOfPointers in interface Modelnumber - The number of pointers in the collection.
public double stirlingPower(double n,
double m)
n - The parameter of the Stirling formula.m - The parameter of the Stirling formula.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||