Documentation of 'jsat.text.wordweighting.OkapiBM25' Java class
OkapiBM25
jsat.text.wordweighting

Class OkapiBM25

    • Constructor Summary

      Constructors 
      Constructor and Description
      OkapiBM25()
      Creates a new Okapi object
      OkapiBM25(double k1, double b)
      Creates a new Okapi object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void applyTo(Vec vec)
      The implementation may want to pre compute come values based on the vector it is about to be applied to.
      double indexFunc(double value, int index)
      An index function, meant to be applied to vectors where the value to be computed may vary based on the position in the vector of the value.
      void setWeight(java.util.List<? extends Vec> allDocuments, java.util.List<java.lang.Integer> df)
      Prepares the word weighting to be performed on a data set.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OkapiBM25

        public OkapiBM25()
        Creates a new Okapi object
      • OkapiBM25

        public OkapiBM25(double k1,
                         double b)
        Creates a new Okapi object
        Parameters:
        k1 - the non negative coefficient to apply to the term frequency
        b - the coefficient to apply to the document length in the range [0,1]
    • Method Detail

      • setWeight

        public void setWeight(java.util.List<? extends Vec> allDocuments,
                              java.util.List<java.lang.Integer> df)
        Description copied from interface: WordWeighting
        Prepares the word weighting to be performed on a data set. This should be called once before being applied to any vectors. Different WordWeightings may require different amounts of computation to set up.
        Specified by:
        setWeight in interface WordWeighting
        Parameters:
        allDocuments - the list of all vectors that make up the set of documents. The word vectors should be unmodified, containing the value of how many times a word appeared in the document for each index.
        df - a list mapping each integer index of a word to how many times that word occurred in total
      • indexFunc

        public double indexFunc(double value,
                                int index)
        Description copied from interface: IndexFunction
        An index function, meant to be applied to vectors where the value to be computed may vary based on the position in the vector of the value.
        Specified by:
        indexFunc in interface IndexFunction
        Parameters:
        value - the value at the specified index
        index - the index the value is from
        Returns:
        the computed result. If a negative index was given, the function should return 0.0 if indexFunc(0,indx) would return zero for all valid indices. If this is not the case, any non zero value should be returned.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.