From 09b5111aca98c9e43f2867cf269aa154d75d826d Mon Sep 17 00:00:00 2001 From: Siraj R Aizlewood <siraj@aurelio.ai> Date: Tue, 23 Jan 2024 23:27:42 +0400 Subject: [PATCH] Fixed self.score_threshold_values Bug User inputted value was being overruled by hardcoded list. --- semantic_router/layer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/semantic_router/layer.py b/semantic_router/layer.py index 4f169588..24722b43 100644 --- a/semantic_router/layer.py +++ b/semantic_router/layer.py @@ -339,10 +339,10 @@ class RouteLayer: class TestRouteSelection: - def __init__(self, route_layer: RouteLayer, test_data: List[Tuple[str, str]], score_threshold_values: Optional[List[float]] = None): + def __init__(self, route_layer: RouteLayer, test_data: List[Tuple[str, str]], score_threshold_values: List[float] = None): self.route_layer = route_layer self.test_data = test_data - self.score_threshold_values = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9] + self.score_threshold_values = score_threshold_values def evaluate(self, score_thresholds: Optional[Dict[str, float]] = None) -> float: correct = 0 -- GitLab