From 09734c56fcbc76881b7d5bba18d1c9792a84abed Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Fri, 28 Jan 2022 09:34:23 +0100 Subject: [PATCH] Use simple suggester for spancat initialization (#10143) Instead of the running the actual suggester, which may require annotation from annotating components that is not necessarily present in the reference docs, use the built-in 1-gram suggester. --- 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 829def1eb..32c1275a6 100644 --- a/spacy/pipeline/spancat.py +++ b/spacy/pipeline/spancat.py @@ -412,7 +412,7 @@ class SpanCategorizer(TrainablePipe): self._require_labels() if subbatch: docs = [eg.x for eg in subbatch] - spans = self.suggester(docs) + spans = build_ngram_suggester(sizes=[1])(docs) Y = self.model.ops.alloc2f(spans.dataXd.shape[0], len(self.labels)) self.model.initialize(X=(docs, spans), Y=Y) else: