From 5de02dc903495c818d253cbf970ae0cd28b791b0 Mon Sep 17 00:00:00 2001 From: Raphael Mitsch Date: Fri, 28 Oct 2022 13:13:38 +0200 Subject: [PATCH] Adjust type check of TextCategorizer to exclude subclasses. --- 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 6baa811d2..fdd3a9550 100644 --- a/spacy/cli/find_threshold.py +++ b/spacy/cli/find_threshold.py @@ -112,7 +112,7 @@ def find_threshold( if not hasattr(pipe, "scorer"): raise AttributeError(Errors.E1045) - if isinstance(pipe, TextCategorizer): + if type(pipe) == TextCategorizer: wasabi.msg.warn( "The `textcat` component doesn't use a threshold as it's not applicable to the concept of " "exclusive classes. All thresholds will yield the same results."