You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
https://github.com/apache/lucene/blob/0345fcabb3ceb71fb39c1aa77502bae220f259ca/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java#L246,How to understand monotonicity?, freq * 1/norm is guaranteed to be monotonic? but My experimental results are the same as freq / (freq + norm).
the code is @test
public void test() {
int length = 2;
float freq = 1.0f;
float[] cache = {16777216.0f, 16777217.0f};
float[] inverseCache = new float[length];
for (int i = 0; i < length; i++) {
inverseCache[i] = 1f / cache[i];
}
for (int i = 0; i < length; i++) {
System.out.println(freq / (freq + cache[i]));
}
for (int i = 0; i < length; i++) {
System.out.println(freq * inverseCache[i]);
}
}
The text was updated successfully, but these errors were encountered:
The problem is not with norm but with freq in that case. Try to compute BM25 scores with a few freqs and you'll find cases when you get a lower score evern though freq is greater by one ulp.
https://github.com/apache/lucene/blob/0345fcabb3ceb71fb39c1aa77502bae220f259ca/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java#L246,How to understand monotonicity?, freq * 1/norm is guaranteed to be monotonic? but My experimental results are the same as freq / (freq + norm).
the code is
@test
public void test() {
int length = 2;
float freq = 1.0f;
float[] cache = {16777216.0f, 16777217.0f};
float[] inverseCache = new float[length];
for (int i = 0; i < length; i++) {
inverseCache[i] = 1f / cache[i];
}
for (int i = 0; i < length; i++) {
System.out.println(freq / (freq + cache[i]));
}
for (int i = 0; i < length; i++) {
System.out.println(freq * inverseCache[i]);
}
}
The text was updated successfully, but these errors were encountered: