org.terrier.matching.models
Class PerFieldNormWeightingModel

java.lang.Object
  extended by org.terrier.matching.models.WeightingModel
      extended by org.terrier.matching.models.PerFieldNormWeightingModel
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Model
Direct Known Subclasses:
BM25F, PL2F

public class PerFieldNormWeightingModel
extends WeightingModel

A class for generating arbitrary per-field normalisation models. Per-field normalisation models are field-based models - i.e. they take into account the frequency of a term in each individual field of the document. In particular, they apply length normalisation on the frequency from each field, before using a linear combination of term frequencies to garner the final frequency.

Properties:

<ul>
  • w.fieldId (starting at 0)
  • c.fieldId (starting at 0)
  • Since:
    3.0
    Author:
    Craig Macdonald
    See Also:
    Serialized Form

    Field Summary
     
    Fields inherited from class org.terrier.matching.models.WeightingModel
    averageDocumentLength, c, documentFrequency, i, keyFrequency, numberOfDocuments, numberOfPointers, numberOfTokens, numberOfUniqueTerms, termFrequency
     
    Constructor Summary
    PerFieldNormWeightingModel(java.lang.Class<? extends BasicModel> _basicModel, java.lang.Class<? extends Normalisation> _normalisationModel)
              Constructs an instance of PerFieldNormWeightingModel
    PerFieldNormWeightingModel(java.lang.String[] parameters)
              Constructs an instance of PerFieldNormWeightingModel
     
    Method Summary
     java.lang.String getInfo()
              Returns the name of the model.
     void prepare()
              prepare
     double score(double tf, double docLength)
              This method provides the contract for implementing weighting models.
     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 setCollectionStatistics(CollectionStatistics _cs)
              Sets collection statistics
     void setEntryStatistics(EntryStatistics _es)
              Sets entry statistics.
     
    Methods inherited from class org.terrier.matching.models.WeightingModel
    clone, getOverflowed, getParameter, setAverageDocumentLength, setDocumentFrequency, setKeyFrequency, setNumberOfDocuments, setNumberOfPointers, setNumberOfTokens, setNumberOfUniqueTerms, setParameter, setRequest, setTermFrequency, stirlingPower
     
    Methods inherited from class java.lang.Object
    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    PerFieldNormWeightingModel

    public PerFieldNormWeightingModel(java.lang.Class<? extends BasicModel> _basicModel,
                                      java.lang.Class<? extends Normalisation> _normalisationModel)
                               throws java.lang.Exception
    Constructs an instance of PerFieldNormWeightingModel

    Parameters:
    _basicModel -
    _normalisationModel -
    Throws:
    java.lang.Exception

    PerFieldNormWeightingModel

    public PerFieldNormWeightingModel(java.lang.String[] parameters)
                               throws java.lang.Exception
    Constructs an instance of PerFieldNormWeightingModel

    Parameters:
    parameters -
    Throws:
    java.lang.Exception
    Method Detail

    prepare

    public void prepare()
    Description copied from class: WeightingModel
    prepare

    Overrides:
    prepare in class WeightingModel

    score

    public double score(Posting _p)
    Description copied from class: WeightingModel
    Returns score

    Overrides:
    score in class WeightingModel
    Returns:
    score

    setCollectionStatistics

    public void setCollectionStatistics(CollectionStatistics _cs)
    Description copied from class: WeightingModel
    Sets collection statistics

    Overrides:
    setCollectionStatistics in class WeightingModel

    setEntryStatistics

    public void setEntryStatistics(EntryStatistics _es)
    Description copied from class: WeightingModel
    Sets entry statistics.

    Overrides:
    setEntryStatistics in class WeightingModel

    getInfo

    public java.lang.String getInfo()
    Description copied from class: WeightingModel
    Returns the name of the model.

    Specified by:
    getInfo in interface Model
    Specified by:
    getInfo in class WeightingModel
    Returns:
    java.lang.String

    score

    public double score(double tf,
                        double docLength)
    Description copied from class: WeightingModel
    This method provides the contract for implementing weighting models.

    Specified by:
    score in class WeightingModel
    Parameters:
    tf - The term frequency in the document
    docLength - the document's length
    Returns:
    the score assigned to a document with the given tf and docLength, and other preset parameters

    score

    public double score(double tf,
                        double docLength,
                        double n_t,
                        double F_t,
                        double keyFrequency)
    Description copied from class: WeightingModel
    This method provides the contract for implementing weighting models.

    Specified by:
    score in class WeightingModel
    Parameters:
    tf - The term frequency in the document
    docLength - the document's length
    n_t - The document frequency of the term
    F_t - the term frequency in the collection
    keyFrequency - the term frequency in the query
    Returns:
    the score returned by the implemented weighting model.


    Terrier 3.5. Copyright © 2004-2011 University of Glasgow