From 8729307e672f80bcc322acdc8a4d2c71ad592b0a Mon Sep 17 00:00:00 2001 From: Sofie Van Landeghem Date: Mon, 14 Jun 2021 10:30:30 +0200 Subject: [PATCH] register extract_ngrams layer (#8358) * register extract_ngrams layer * fix import * bump spacy-legacy to 3.0.6 * revert bump (wrong PR) --- spacy/ml/extract_ngrams.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/ml/extract_ngrams.py b/spacy/ml/extract_ngrams.py index 7e1cce884..c1c2929fd 100644 --- a/spacy/ml/extract_ngrams.py +++ b/spacy/ml/extract_ngrams.py @@ -1,8 +1,10 @@ from thinc.api import Model +from ..util import registry from ..attrs import LOWER +@registry.layers("spacy.extract_ngrams.v1") def extract_ngrams(ngram_size: int, attr: int = LOWER) -> Model: model = Model("extract_ngrams", forward) model.attrs["ngram_size"] = ngram_size