private static class BM25Similarity.BM25Stats extends Similarity.SimWeight
Modifier and Type | Field and Description |
---|---|
private float |
avgdl
The average document length.
|
private float |
boost
query boost
|
private float[] |
cache
precomputed norm[256] with k1 * ((1 - b) + b * dl / avgdl)
|
private java.lang.String |
field
field name, for pulling norms
|
private Explanation |
idf
BM25's idf
|
private float |
weight
weight (idf * boost)
|
Constructor and Description |
---|
BM25Stats(java.lang.String field,
Explanation idf,
float avgdl,
float[] cache) |
Modifier and Type | Method and Description |
---|---|
float |
getValueForNormalization()
The value for normalization of contained query clauses (e.g.
|
void |
normalize(float queryNorm,
float boost)
Assigns the query normalization factor and boost from parent queries to this.
|
private final Explanation idf
private final float avgdl
private float boost
private float weight
private final java.lang.String field
private final float[] cache
BM25Stats(java.lang.String field, Explanation idf, float avgdl, float[] cache)
public float getValueForNormalization()
Similarity.SimWeight
NOTE: a Similarity implementation might not use any query normalization at all, it's not required. However, if it wants to participate in query normalization, it can return a value here.
getValueForNormalization
in class Similarity.SimWeight
public void normalize(float queryNorm, float boost)
Similarity.SimWeight
NOTE: a Similarity implementation might not use this normalized value at all, it's not required. However, it's usually a good idea to at least incorporate the boost into its score.
NOTE: If this method is called several times, it behaves as if only the last call was performed.
normalize
in class Similarity.SimWeight