Class AfterEffect

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    Direct Known Subclasses:
    B, L, L5, LL

    public abstract class AfterEffect
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Cloneable
    This class provides a contract for implementing the first normalisation by after effect models for the DFR framework. This is referred to as the component (1-prob2) in the DFR framework. Classes implementing this interface are used by the DFRWeightingModel.
    Author:
    Ben He
    See Also:
    DFRWeightingModel, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double avl
      The average document length in collection.
      protected double parameter
      The term frequency normalisation parameter used for method L5
    • Constructor Summary

      Constructors 
      Constructor Description
      AfterEffect()
      A default constructor
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      AfterEffect clone()
      Clone this weighting model
      abstract double gain​(double tf, double documentFrequency, double termFrequency)
      This method provides the contract for implementing first normalisation by after effect.
      abstract java.lang.String getInfo()
      Returns the name of the model.
      double getParameter()  
      void setAverageDocumentLength​(double value)
      Set the average document length, which is used for computing the prior for the first normalisation.
      void setParameter​(double _parameter)  
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • avl

        protected double avl
        The average document length in collection.
      • parameter

        protected double parameter
        The term frequency normalisation parameter used for method L5
    • Constructor Detail

      • AfterEffect

        public AfterEffect()
        A default constructor
    • Method Detail

      • clone

        public AfterEffect clone()
        Clone this weighting model
        Overrides:
        clone in class java.lang.Object
      • setAverageDocumentLength

        public void setAverageDocumentLength​(double value)
        Set the average document length, which is used for computing the prior for the first normalisation.
        Parameters:
        value - The average document length.
      • getParameter

        public double getParameter()
        Returns:
        the term frequency normalisation parameter
      • setParameter

        public void setParameter​(double _parameter)
        Parameters:
        _parameter - the term frequency normalisation parameter value to set
      • getInfo

        public abstract java.lang.String getInfo()
        Returns the name of the model.
        Returns:
        java.lang.String
      • gain

        public abstract double gain​(double tf,
                                    double documentFrequency,
                                    double termFrequency)
        This method provides the contract for implementing first normalisation by after effect.
        Parameters:
        tf - The term frequency in the document
        documentFrequency - The document frequency of the given query term
        termFrequency - The frequency of the given term in the whole collection.
        Returns:
        The gain of having one more occurrence of the query term.