From 604c5eab3d556540bc1fbf04cb68c7bd137ecef4 Mon Sep 17 00:00:00 2001 From: Raphael Mitsch Date: Thu, 29 Sep 2022 10:40:30 +0200 Subject: [PATCH] Update spacy/cli/find_threshold.py Co-authored-by: Adriane Boyd --- spacy/cli/find_threshold.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spacy/cli/find_threshold.py b/spacy/cli/find_threshold.py index 41210a0c6..a506d21d6 100644 --- a/spacy/cli/find_threshold.py +++ b/spacy/cli/find_threshold.py @@ -167,9 +167,7 @@ def find_threshold( ) scores[threshold] = nlp.evaluate(dev_dataset)[scores_key] - if not isinstance(scores[threshold], float) and not isinstance( - scores[threshold], int - ): + if not isinstance(scores[threshold], (float, int)): wasabi.msg.fail( f"Returned score for key '{scores_key}' is not numeric. Threshold optimization only works for numeric " f"scores.",