org.terrier.matching.models.normalisation
Class Normalisation

java.lang.Object
  extended by org.terrier.matching.models.normalisation.Normalisation
All Implemented Interfaces:
java.io.Serializable
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

This class provides a contract for implementing frequency normalisation methods. Properties

Author:
Ben He
See Also:
Serialized Form

Field Summary
protected  double averageDocumentLength
          The average document length in the collection.
protected  Idf idf
          The class used for computing the logorithm values.
protected  double Nt
          The document frequency of the term.
protected  double numberOfDocuments
          The number of documents in the whole collection.
protected  double numberOfTokens
          The number of tokens in the whole collection.
protected  double parameter
          The free parameter of the normalisation method.
protected  double termFrequency
          The frequency of the query term in the whole collection.
 
Constructor Summary
Normalisation()
          The default constructor.
Normalisation(double value)
          The constructor that specifies the parameter value.
 
Method Summary
abstract  java.lang.String getInfo()
          This method provides the contract for getting the name of the implemented frequency normalisation method.
 double getParameter()
          Returns the hyper-parameter value.
abstract  double normalise(double tf, double docLength, double _termFrequency)
          This method provides the contract for implementing the frequency normalisation formula.
 void setAverageDocumentLength(double value)
          Set the average document length in the collection.
 void setDocumentFrequency(double nt)
           
 void setNumberOfDocuments(double _numberOfDocuments)
           
 void setNumberOfTokens(double value)
          Set the number of tokens in the collection.
 void setParameter(double value)
          Specify the free parameter of the implemented frequency normalisation method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

averageDocumentLength

protected double averageDocumentLength
The average document length in the collection.


idf

protected Idf idf
The class used for computing the logorithm values.


termFrequency

protected double termFrequency
The frequency of the query term in the whole collection.


parameter

protected double parameter
The free parameter of the normalisation method.


numberOfTokens

protected double numberOfTokens
The number of tokens in the whole collection.


Nt

protected double Nt
The document frequency of the term.


numberOfDocuments

protected double numberOfDocuments
The number of documents in the whole collection.

Constructor Detail

Normalisation

public Normalisation()
The default constructor.


Normalisation

public Normalisation(double value)
The constructor that specifies the parameter value.

Parameters:
value - The specified value of the free parameter of the implemented frequency normalisation method.
Method Detail

setAverageDocumentLength

public void setAverageDocumentLength(double value)
Set the average document length in the collection.

Parameters:
value - The average document length in the collection.

setNumberOfTokens

public void setNumberOfTokens(double value)
Set the number of tokens in the collection.

Parameters:
value - The number of tokens in the collection.

setParameter

public void setParameter(double value)
Specify the free parameter of the implemented frequency normalisation method.

Parameters:
value - The specified value of the frequency normalisation parameter.

getParameter

public double getParameter()
Returns the hyper-parameter value.

Returns:
The hyper-parameter value.

getInfo

public 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.

normalise

public 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.

setDocumentFrequency

public void setDocumentFrequency(double nt)
Parameters:
nt - the document frequency to set

setNumberOfDocuments

public void setNumberOfDocuments(double _numberOfDocuments)
Parameters:
_numberOfDocuments - the numberOfDocuments to set


Terrier 3.5. Copyright © 2004-2011 University of Glasgow