From 0800a6c1475605d742ff3b6325baed08dd37fecb Mon Sep 17 00:00:00 2001 From: Anindyadeep Date: Tue, 14 Nov 2023 13:37:34 +0530 Subject: [PATCH] Fix: Minor bug in mean calculation. --- deepeval/metrics/scoring.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepeval/metrics/scoring.py b/deepeval/metrics/scoring.py index 73e43657f..65f83fac6 100644 --- a/deepeval/metrics/scoring.py +++ b/deepeval/metrics/scoring.py @@ -255,7 +255,7 @@ def neural_toxic_score( else: detoxify_model = Detoxify("original", device=device) toxicity_score_dict = detoxify_model.predict(prediction) - mean_toxicity_score = list(toxicity_score_dict.values()) / len( + mean_toxicity_score = sum(list(toxicity_score_dict.values())) / len( toxicity_score_dict ) return mean_toxicity_score, toxicity_score_dict