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
Fields inherited from class org.apache.lucene.search.similarities.SimilarityBase
discountOverlaps
-
Constructor Summary
ConstructorDescriptionDefault 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 double
gamma
(BasicStats stats, double freq, double docLen) compute the gamma componentprotected double
idf
(BasicStats stats, double freq, double docLen) compute the inverted document frequency componentprotected Explanation
idfExplain
(BasicStats stats, double freq, double docLen) Explain the score of the inverted document frequency component for a single documentprotected double
ln
(BasicStats stats, double freq, double docLen) compute the document length componentprotected Explanation
lnExplain
(BasicStats stats, double freq, double docLen) Explain the score of the document length component for a single documentprotected double
tf
(BasicStats stats, double freq, double docLen) compute the term frequency componentprotected Explanation
tfExplain
(BasicStats stats, double freq, double docLen) Explain the score of the term frequency component for a single documentprotected double
tfln
(BasicStats stats, double freq, double docLen) compute the mixed term frequency and document length componentprotected Explanation
tflnExplain
(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, score
Methods inherited from class org.apache.lucene.search.similarities.SimilarityBase
computeNorm, fillBasicStats, getDiscountOverlaps, log2, newStats, scorer, setDiscountOverlaps
-
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:Axiomatic
Name 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:Axiomatic
Explain the score of the term frequency component for a single document -
lnExplain
Description copied from class:Axiomatic
Explain the score of the document length component for a single document -
tflnExplain
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 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:Axiomatic
Explain the score of the inverted document frequency component for a single document- Specified by:
idfExplain
in 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
-