Class DFRSimilarity

  • public class DFRSimilarity
    extends SimilarityBase
    Implements the divergence from randomness (DFR) framework introduced in Gianni Amati and Cornelis Joost Van Rijsbergen. 2002. Probabilistic models of information retrieval based on measuring the divergence from randomness. ACM Trans. Inf. Syst. 20, 4 (October 2002), 357-389.

    The DFR scoring formula is composed of three separate components: the basic model, the aftereffect and an additional normalization component, represented by the classes BasicModel, AfterEffect and Normalization, respectively. The names of these classes were chosen to match the names of their counterparts in the Terrier IR engine.

    To construct a DFRSimilarity, you must specify the implementations for all three components of DFR:

    1. BasicModel: Basic model of information content:
    2. AfterEffect: First normalization of information gain:
    3. Normalization: Second (length) normalization:

    Note that qtf, the multiplicity of term-occurrence in the query, is not handled by this implementation.

    See Also:
    BasicModel, AfterEffect, Normalization
    • Constructor Detail

      • DFRSimilarity

        public DFRSimilarity​(BasicModel basicModel,
                             AfterEffect afterEffect,
                             Normalization normalization)
        Creates DFRSimilarity from the three components.

        Note that null values are not allowed: if you want no normalization or after-effect, instead pass Normalization.NoNormalization or AfterEffect.NoAfterEffect respectively.

        basicModel - Basic model of information content
        afterEffect - First normalization of information gain
        normalization - Second (length) normalization
    • Method Detail

      • toString

        public java.lang.String toString()
        Description copied from class: SimilarityBase
        Subclasses must override this method to return the name of the Similarity and preferably the values of parameters (if any) as well.
        Specified by:
        toString in class SimilarityBase
      • getBasicModel

        public BasicModel getBasicModel()
        Returns the basic model of information content
      • getAfterEffect

        public AfterEffect getAfterEffect()
        Returns the first normalization
      • getNormalization

        public Normalization getNormalization()
        Returns the second normalization