Update calculatePercentage CitationsModal.svelte
Fixes #6904 : Percentage score is high when low relevance and vice-versa.
This commit is contained in:
1 parent
6caf838964
commit
ad0b599940
1 file changed
+3
-3
@@ -13,9 +13,9 @@
|
||||
let mergedDocuments = [];
|
||||
|
||||
function calculatePercentage(distance: number) {
|
||||
if (distance < 0) return 100;
|
||||
if (distance > 1) return 0;
|
||||
return Math.round((1 - distance) * 10000) / 100;
|
||||
if (distance < 0) return 0;
|
||||
if (distance > 1) return 100;
|
||||
return Math.round((distance * 10000) / 100;
|
||||
}
|
||||
|
||||
function getRelevanceColor(percentage: number) {
|
||||
|
||||
Reference in new issue
Block a user