Class AxiomaticF1EXP
java.lang.Object
org.apache.lucene.search.similarities.Similarity
org.apache.lucene.search.similarities.SimilarityBase
org.apache.lucene.search.similarities.Axiomatic
org.apache.lucene.search.similarities.AxiomaticF1EXP
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.similarities.Similarity
Similarity.SimScorer -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorAxiomaticF1EXP(float s) Constructor setting s only, letting k and queryLen to defaultAxiomaticF1EXP(float s, float k) Constructor setting s and k, letting queryLen to default -
Method Summary
Modifier and TypeMethodDescriptionprotected doublegamma(BasicStats stats, double freq, double docLen) compute the gamma componentprotected doubleidf(BasicStats stats, double freq, double docLen) compute the inverted document frequency componentprotected ExplanationidfExplain(BasicStats stats, double freq, double docLen) Explain the score of the inverted document frequency component for a single documentprotected doubleln(BasicStats stats, double freq, double docLen) compute the document length componentprotected ExplanationlnExplain(BasicStats stats, double freq, double docLen) Explain the score of the document length component for a single documentprotected doubletf(BasicStats stats, double freq, double docLen) compute the term frequency componentprotected ExplanationtfExplain(BasicStats stats, double freq, double docLen) Explain the score of the term frequency component for a single documentprotected doubletfln(BasicStats stats, double freq, double docLen) compute the mixed term frequency and document length componentprotected ExplanationtflnExplain(BasicStats stats, double freq, double docLen) Explain the score of the mixed term frequency and document length component for a single documenttoString()Name of the axiomatic method.Methods inherited from class org.apache.lucene.search.similarities.Axiomatic
explain, explain, scoreMethods inherited from class org.apache.lucene.search.similarities.SimilarityBase
fillBasicStats, log2, newStats, scorerMethods inherited from class org.apache.lucene.search.similarities.Similarity
computeNorm, getDiscountOverlaps
-
Constructor Details
-
AxiomaticF1EXP
public AxiomaticF1EXP(float s, float k) Constructor setting s and k, letting queryLen to default- Parameters:
s- hyperparam for the growth functionk- 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
Description copied from class:AxiomaticName of the axiomatic method. -
tf
compute the term frequency component -
ln
compute the document length component -
tfln
compute the mixed term frequency and document length component -
idf
compute the inverted document frequency component -
gamma
compute the gamma component -
tfExplain
Description copied from class:AxiomaticExplain the score of the term frequency component for a single document -
lnExplain
Description copied from class:AxiomaticExplain the score of the document length component for a single document -
tflnExplain
Description copied from class:AxiomaticExplain the score of the mixed term frequency and document length component for a single document- Specified by:
tflnExplainin classAxiomatic- Parameters:
stats- the corpus level statisticsfreq- number of occurrences of term in the documentdocLen- the document length- Returns:
- Explanation of how the tfln component was computed
-
idfExplain
Description copied from class:AxiomaticExplain the score of the inverted document frequency component for a single document- Specified by:
idfExplainin classAxiomatic- Parameters:
stats- the corpus level statisticsfreq- number of occurrences of term in the documentdocLen- the document length- Returns:
- Explanation of how the idf component was computed
-