Spaces:
Running
Running
Update core/fusion.py
Browse files- core/fusion.py +13 -13
core/fusion.py
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
# judge_score is 1..5 (int). nlp_subscore is 0..1. alpha in [0,1]
|
| 4 |
|
| 5 |
-
|
| 6 |
-
js = 0.0
|
| 7 |
-
if judge_score is not None:
|
| 8 |
-
try:
|
| 9 |
-
js = max(0.0, min(1.0, float(judge_score) / 5.0))
|
| 10 |
-
except Exception:
|
| 11 |
-
js = 0.0
|
| 12 |
-
ns = max(0.0, min(1.0, float(nlp_subscore)))
|
| 13 |
-
fused_0_1 = alpha * js + (1 - alpha) * ns
|
| 14 |
-
return round(fused_0_1 * 10.0, 2)
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
def weighted_total(metric_scores_0_10: Dict[str, float], weights: Dict[str, float]) -> float:
|
| 18 |
tot = 0.0
|
|
|
|
| 1 |
+
# core/fusion.py (simplified: no fusion, just pass-through)
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
from typing import Dict
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
+
def normalize_llm_score(judge_score) -> float:
|
| 6 |
+
"""
|
| 7 |
+
Convert LLM score (1–5) into 0–10 scale.
|
| 8 |
+
If None, return 0.
|
| 9 |
+
"""
|
| 10 |
+
if judge_score is None:
|
| 11 |
+
return 0.0
|
| 12 |
+
try:
|
| 13 |
+
return round(max(0.0, min(5.0, float(judge_score))) * 2.0, 2)
|
| 14 |
+
except Exception:
|
| 15 |
+
return 0.0
|
| 16 |
|
| 17 |
def weighted_total(metric_scores_0_10: Dict[str, float], weights: Dict[str, float]) -> float:
|
| 18 |
tot = 0.0
|