mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 05:18:58 +00:00
(index) Tune ranking for verbatim matches in the title, rewarding shorter titles
This commit is contained in:
parent
b21f8538a8
commit
ee49c01d86
@ -197,7 +197,7 @@ public class IndexResultScoreCalculator {
|
|||||||
temporalBias = 0;
|
temporalBias = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int titleLength = spans.title.length();
|
final int titleLength = Math.max(1, spans.title.length());
|
||||||
|
|
||||||
float coherenceScore = 0.f;
|
float coherenceScore = 0.f;
|
||||||
|
|
||||||
@ -246,7 +246,9 @@ public class IndexResultScoreCalculator {
|
|||||||
coherenceScore = 0.75f * largestOptional;
|
coherenceScore = 0.75f * largestOptional;
|
||||||
}
|
}
|
||||||
|
|
||||||
coherenceScore += (float) Math.pow(coherences.countOptional(positions) / (double) coherences.numOptional(), 2);
|
if (coherences.numOptional() > 0) {
|
||||||
|
coherenceScore += (float) Math.pow(coherences.countOptional(positions) / (double) coherences.numOptional(), 2);
|
||||||
|
}
|
||||||
|
|
||||||
float[] weightedCounts = new float[compiledQuery.size()];
|
float[] weightedCounts = new float[compiledQuery.size()];
|
||||||
int firstPosition = Integer.MAX_VALUE;
|
int firstPosition = Integer.MAX_VALUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user