mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 21:18:58 +00:00
(ranking) Suppress NaN:s in ranking output
This commit is contained in:
parent
426338cb45
commit
3ab563f314
@ -124,11 +124,20 @@ public class ResultValuator {
|
|||||||
|
|
||||||
// Renormalize to 0...15, where 0 is the best possible score;
|
// Renormalize to 0...15, where 0 is the best possible score;
|
||||||
// this is a historical artifact of the original ranking function
|
// this is a historical artifact of the original ranking function
|
||||||
return normalize(
|
double ret = normalize(
|
||||||
tcfOverlap + tcfJaccard
|
tcfOverlap + tcfJaccard
|
||||||
+ bM25F + bM25P + bM25N
|
+ bM25F + bM25P + bM25N
|
||||||
+ overallPartPositive,
|
+ overallPartPositive,
|
||||||
overallPartNegative);
|
overallPartNegative);
|
||||||
|
|
||||||
|
if (Double.isNaN(ret)) {
|
||||||
|
if (getClass().desiredAssertionStatus()) {
|
||||||
|
throw new IllegalStateException("NaN in result value calculation");
|
||||||
|
}
|
||||||
|
|
||||||
|
return Double.MAX_VALUE;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double calculateQualityPenalty(int size, int quality, ResultRankingParameters rankingParams) {
|
private double calculateQualityPenalty(int size, int quality, ResultRankingParameters rankingParams) {
|
||||||
|
Loading…
Reference in New Issue
Block a user