Adjust type check of TextCategorizer to exclude subclasses.

This commit is contained in:
Raphael Mitsch 2022-10-28 13:13:38 +02:00
parent 5bacad8f67
commit 5de02dc903

View File

@ -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."