From afc3ce1c7eca48dbc07c6dddb235fff938c40eba Mon Sep 17 00:00:00 2001 From: kadarakos Date: Mon, 6 Feb 2023 19:05:35 +0000 Subject: [PATCH] logical bug in configuration check --- spacy/pipeline/spancat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/pipeline/spancat.py b/spacy/pipeline/spancat.py index 737d4ef03..d1dd2b9d5 100644 --- a/spacy/pipeline/spancat.py +++ b/spacy/pipeline/spancat.py @@ -368,7 +368,7 @@ class SpanCategorizer(TrainablePipe): self.add_negative_label = add_negative_label if allow_overlap is None: self.cfg["allow_overlap"] = True - elif not allow_overlap and cast(int, max_positive) > 1: + elif not allow_overlap and max_positive is not None and max_positive > 1: self.cfg["allow_overlap"] = True msg.warn( "'allow_overlap' can only be False when max_positive=1, "