From 34c6c3b7c9afeebfc09f22e47b432ed98b23ff1e Mon Sep 17 00:00:00 2001 From: Raphael Mitsch Date: Fri, 11 Nov 2022 11:33:50 +0100 Subject: [PATCH] Change check of if there's only one unique value in scores. --- spacy/cli/find_threshold.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/cli/find_threshold.py b/spacy/cli/find_threshold.py index fdd3a9550..df2e99017 100644 --- a/spacy/cli/find_threshold.py +++ b/spacy/cli/find_threshold.py @@ -193,7 +193,7 @@ def find_threshold( best_threshold = max(scores.keys(), key=(lambda key: scores[key])) # If all scores are identical, emit warning. - if all([score == scores[thresholds[0]] for score in scores.values()]): + if len(set(scores.values())) == 1: wasabi.msg.warn( title="All scores are identical. Verify that all settings are correct.", text=""