Class AxiomaticF1EXP


public class AxiomaticF1EXP extends Axiomatic
F1EXP is defined as Sum(tf(term_doc_freq)*ln(docLen)*IDF(term)) where IDF(t) = pow((N+1)/df(t), k) N=total num of docs, df=doc freq
WARNING: This API is experimental and might change in incompatible ways in the next release.
  • Constructor Details

    • AxiomaticF1EXP

      public AxiomaticF1EXP(float s, float k)
      Constructor setting s and k, letting queryLen to default
      Parameters:
      s - hyperparam for the growth function
      k - hyperparam for the primitive weighting function
    • AxiomaticF1EXP

      public AxiomaticF1EXP(float s)
      Constructor setting s only, letting k and queryLen to default
      Parameters:
      s - hyperparam for the growth function
    • AxiomaticF1EXP

      public AxiomaticF1EXP()
      Default constructor
  • Method Details

    • toString

      public String toString()
      Description copied from class: Axiomatic
      Name of the axiomatic method.
      Specified by:
      toString in class Axiomatic
    • tf

      protected double tf(BasicStats stats, double freq, double docLen)
      compute the term frequency component
      Specified by:
      tf in class Axiomatic
    • ln

      protected double ln(BasicStats stats, double freq, double docLen)
      compute the document length component
      Specified by:
      ln in class Axiomatic
    • tfln

      protected double tfln(BasicStats stats, double freq, double docLen)
      compute the mixed term frequency and document length component
      Specified by:
      tfln in class Axiomatic
    • idf

      protected double idf(BasicStats stats, double freq, double docLen)
      compute the inverted document frequency component
      Specified by:
      idf in class Axiomatic
    • gamma

      protected double gamma(BasicStats stats, double freq, double docLen)
      compute the gamma component
      Specified by:
      gamma in class Axiomatic
    • tfExplain

      protected Explanation tfExplain(BasicStats stats, double freq, double docLen)
      Description copied from class: Axiomatic
      Explain the score of the term frequency component for a single document
      Specified by:
      tfExplain in class Axiomatic
      Parameters:
      stats - the corpus level statistics
      freq - number of occurrences of term in the document
      docLen - the document length
      Returns:
      Explanation of how the tf component was computed
    • lnExplain

      protected Explanation lnExplain(BasicStats stats, double freq, double docLen)
      Description copied from class: Axiomatic
      Explain the score of the document length component for a single document
      Specified by:
      lnExplain in class Axiomatic
      Parameters:
      stats - the corpus level statistics
      freq - number of occurrences of term in the document
      docLen - the document length
      Returns:
      Explanation of how the ln component was computed
    • tflnExplain

      protected Explanation tflnExplain(BasicStats stats, double freq, double docLen)
      Description copied from class: Axiomatic
      Explain the score of the mixed term frequency and document length component for a single document
      Specified by:
      tflnExplain in class Axiomatic
      Parameters:
      stats - the corpus level statistics
      freq - number of occurrences of term in the document
      docLen - the document length
      Returns:
      Explanation of how the tfln component was computed
    • idfExplain

      protected Explanation idfExplain(BasicStats stats, double freq, double docLen)
      Description copied from class: Axiomatic
      Explain the score of the inverted document frequency component for a single document
      Specified by:
      idfExplain in class Axiomatic
      Parameters:
      stats - the corpus level statistics
      freq - number of occurrences of term in the document
      docLen - the document length
      Returns:
      Explanation of how the idf component was computed