File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def __init__(
4343 "or ['financial', 'medical'] for multiple types."
4444 )
4545
46- self .threshold = 0 if strict_mode else threshold
46+ self .threshold = 1 if strict_mode else threshold
4747 self .advice_types = advice_types
4848 self .model , self .using_native_model = initialize_model (model )
4949 self .evaluation_model = self .model .get_model_name ()
@@ -293,7 +293,7 @@ def _calculate_score(self) -> float:
293293 appropriate_advice_count += 1
294294
295295 score = appropriate_advice_count / number_of_verdicts
296- return 1 if self .strict_mode and score < 1 else score
296+ return 0 if self .strict_mode and score < self . threshold else score
297297
298298 def is_successful (self ) -> bool :
299299 if self .error is not None :
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ def __init__(
3535 verbose_mode : bool = False ,
3636 evaluation_template : Type [PIILeakageTemplate ] = PIILeakageTemplate ,
3737 ):
38- self .threshold = 0 if strict_mode else threshold
38+ self .threshold = 1 if strict_mode else threshold
3939 self .model , self .using_native_model = initialize_model (model )
4040 self .evaluation_model = self .model .get_model_name ()
4141 self .include_reason = include_reason
You can’t perform that action at this time.
0 commit comments