|
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 uk.ac.gla.terrier.matching.models.DFRWeightingModel
public class DFRWeightingModel
This class implements a modular DFR model. Components in the model
are specified individually. Besides of the basic model, the other two
components can be either specified or disabled.
Constructor Summary | |
---|---|
DFRWeightingModel(java.lang.String[] components)
The default constructor. |
Method Summary | |
---|---|
java.lang.String |
getInfo()
Returns the name of the model. |
double |
getParameter()
Return the parameter set by setParameter() |
double |
score(double tf,
double docLength)
Compute a weight for a term in a document. |
double |
score(double tf,
double docLength,
double documentFrequency,
double termFrequency,
double queryTermWeight)
Compute a weight for a term in a document. |
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 |
setNumberOfDocuments(double numOfDocs)
Sets the number of documents 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 value)
Set the frequency normalisation parameter. |
Methods inherited from class uk.ac.gla.terrier.matching.models.WeightingModel |
---|
clone, setKeyFrequency, setNumberOfPointers, setTermFrequency, stirlingPower |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DFRWeightingModel(java.lang.String[] components)
components
- Corresponds to the names of the 3 DFR weighting models component
names, as passed to initialise().Method Detail |
---|
public void setAverageDocumentLength(double avgDocLength)
setAverageDocumentLength
in interface Model
setAverageDocumentLength
in class WeightingModel
avgDocLength
- The documents' average length.public void setNumberOfDocuments(double numOfDocs)
setNumberOfDocuments
in interface Model
setNumberOfDocuments
in class WeightingModel
numOfDocs
- the number of documents in the collection.public void setNumberOfTokens(double value)
setNumberOfTokens
in interface Model
setNumberOfTokens
in class WeightingModel
value
- The number of tokens in the collection.public void setNumberOfUniqueTerms(double number)
setNumberOfUniqueTerms
in interface Model
setNumberOfUniqueTerms
in class WeightingModel
number
- double The number of unique terms in the collection.public void setParameter(double value)
setParameter
in interface Model
setParameter
in class WeightingModel
value
- The given parameter value.public double getParameter()
getParameter
in interface Model
getParameter
in class WeightingModel
public final java.lang.String getInfo()
getInfo
in interface Model
getInfo
in class WeightingModel
public void setDocumentFrequency(double docFreq)
setDocumentFrequency
in class WeightingModel
docFreq
- the document frequency of the term in the collection.public final double score(double tf, double docLength)
score
in class WeightingModel
tf
- The term frequency in the documentdocLength
- the document's length
public final double score(double tf, double docLength, double documentFrequency, double termFrequency, double queryTermWeight)
score
in class WeightingModel
tf
- The term frequency in the documentdocLength
- the document's lengthdocumentFrequency
- The document frequency of the termtermFrequency
- the term frequency in the collectionqueryTermWeight
- the term frequency in the query
|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |