Class Normalisation
- java.lang.Object
- 
- org.terrier.matching.models.normalisation.Normalisation
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Cloneable
 - Direct Known Subclasses:
- Normalisation0,- Normalisation1,- Normalisation2,- Normalisation2exp,- Normalisation3,- NormalisationB,- NormalisationF,- NormalisationJ,- NormalisationJN,- NormalisationP,- NormalisationStatic
 
 public abstract class Normalisation extends java.lang.Object implements java.io.Serializable, java.lang.CloneableThis class provides a contract for implementing frequency normalisation methods. Properties- field.retrieval - A boolean variable that indicates if field-retrieval is enabled. This allows for further extension with retrieval over different fields.
 - Author:
- Ben He
- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected doubleaverageDocumentLengthThe average document length in the collection.protected IdfidfThe class used for computing the logorithm values.protected doubleNtThe document frequency of the term.protected doublenumberOfDocumentsThe number of documents in the whole collection.protected doublenumberOfTokensThe number of tokens in the whole collection.protected doubleparameterThe free parameter of the normalisation method.protected doubletermFrequencyThe frequency of the query term in the whole collection.
 - 
Constructor SummaryConstructors Constructor Description Normalisation()The default constructor.Normalisation(double value)The constructor that specifies the parameter value.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Normalisationclone()Clone this weighting modelabstract java.lang.StringgetInfo()This method provides the contract for getting the name of the implemented frequency normalisation method.doublegetParameter()Returns the hyper-parameter value.abstract doublenormalise(double tf, double docLength, double _termFrequency)This method provides the contract for implementing the frequency normalisation formula.voidsetAverageDocumentLength(double value)Set the average document length in the collection.voidsetDocumentFrequency(double nt)voidsetNumberOfDocuments(double _numberOfDocuments)voidsetNumberOfTokens(double value)Set the number of tokens in the collection.voidsetParameter(double value)Specify the free parameter of the implemented frequency normalisation method.
 
- 
- 
- 
Field Detail- 
averageDocumentLengthprotected double averageDocumentLength The average document length in the collection.
 - 
idfprotected Idf idf The class used for computing the logorithm values.
 - 
termFrequencyprotected double termFrequency The frequency of the query term in the whole collection.
 - 
parameterprotected double parameter The free parameter of the normalisation method.
 - 
numberOfTokensprotected double numberOfTokens The number of tokens in the whole collection.
 - 
Ntprotected double Nt The document frequency of the term.
 - 
numberOfDocumentsprotected double numberOfDocuments The number of documents in the whole collection.
 
- 
 - 
Method Detail- 
clonepublic Normalisation clone() Clone this weighting model- Overrides:
- clonein class- java.lang.Object
 
 - 
setAverageDocumentLengthpublic void setAverageDocumentLength(double value) Set the average document length in the collection.- Parameters:
- value- The average document length in the collection.
 
 - 
setNumberOfTokenspublic void setNumberOfTokens(double value) Set the number of tokens in the collection.- Parameters:
- value- The number of tokens in the collection.
 
 - 
setParameterpublic void setParameter(double value) Specify the free parameter of the implemented frequency normalisation method.- Parameters:
- value- The specified value of the frequency normalisation parameter.
 
 - 
getParameterpublic double getParameter() Returns the hyper-parameter value.- Returns:
- The hyper-parameter value.
 
 - 
getInfopublic abstract java.lang.String getInfo() This method provides the contract for getting the name of the implemented frequency normalisation method.- Returns:
- The name of the implemented frequency normalisation method.
 
 - 
normalisepublic abstract double normalise(double tf, double docLength, double _termFrequency)This method provides the contract for implementing the frequency normalisation formula.- Parameters:
- tf- The frequency of the query term in the document.
- docLength- The number of tokens in the document.
- _termFrequency- The frequency of the query term in the collection.
- Returns:
- The normalised term frequency.
 
 - 
setDocumentFrequencypublic void setDocumentFrequency(double nt) - Parameters:
- nt- the document frequency to set
 
 - 
setNumberOfDocumentspublic void setNumberOfDocuments(double _numberOfDocuments) - Parameters:
- _numberOfDocuments- the numberOfDocuments to set
 
 
- 
 
-