public class WeightingModelLibrary extends Object
Modifier and Type | Field and Description |
---|---|
static double |
LOG_2_OF_E
The logarithm in base 2 of e, used to change the base of logarithms.
|
static double |
LOG_E_OF_2
The natural logarithm of 2, used to change the base of logarithms.
|
Constructor and Description |
---|
WeightingModelLibrary() |
Modifier and Type | Method and Description |
---|---|
static double |
log(double d)
Returns the base 2 log of the given double precision number.
|
static double |
log(double d1,
double d2)
Returns the base 2 log of d1 over d2
|
static double |
relativeFrequency(double tf,
double docLength)
Computes relative term frequency.
|
static double |
stirlingPower(double n,
double m)
This method provides the contract for implementing the
Stirling formula for the power series.
|
static double |
tf_concave_k(double tf,
double k)
Returns a concave tf as described in Robertson and Walker, 1994.
|
static double |
tf_concave_log(double tf)
Returns a concave tf as described in Singhal et al., 1999.
|
static double |
tf_cornell(double tf,
double s,
double dl,
double avdl)
Returns a concave pivot length normalized tf as described in Singhal et al., 1999.
|
static double |
tf_pivoted(double tf,
double slope,
double dl,
double avdl)
Returns a modified tf with pivot length normalization as described in Singhal et al., 1996.
|
static double |
tf_robertson(double tf,
double b,
double dl,
double avdl,
double k1)
Returns a concave pivot length normalized tf as described in Robertson et al., 1999.
|
public static final double LOG_E_OF_2
public static final double LOG_2_OF_E
public static double log(double d)
d
- The number of which the log we will computepublic static double log(double d1, double d2)
d1
- the numeratord2
- the denominatorpublic static double tf_pivoted(double tf, double slope, double dl, double avdl)
tf
- the term frequency to modifyslope
- the slopedl
- the document lengthavdl
- the average document length in the collectionpublic static double tf_concave_k(double tf, double k)
tf
- the term frequency to modifyk
- the concavity coefficientpublic static double tf_concave_log(double tf)
tf
- the term frequency to modifypublic static final double relativeFrequency(double tf, double docLength)
tf
- raw term frequencydocLength
- length of the documentpublic static double tf_robertson(double tf, double b, double dl, double avdl, double k1)
tf
- the term frequency to modifyb
- the slopedl
- the document lengthavdl
- the average document length in the collectionk1
- the concavity coefficientpublic static double tf_cornell(double tf, double s, double dl, double avdl)
tf
- the term frequency to modifys
- the slopedl
- the document lengthavdl
- the average document length in the collectionpublic static double stirlingPower(double n, double m)
n
- The parameter of the Stirling formula.m
- The parameter of the Stirling formula.Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow