From 836bfa2d0f8957cbab6e90575d4cb15e22f0ab64 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 5 Jun 2017 15:40:22 +0200 Subject: [PATCH] Add factory for experimental SimilarityHook component --- spacy/language.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spacy/language.py b/spacy/language.py index 106076d25..bd90fa395 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -17,9 +17,12 @@ from .tagger import Tagger from .lemmatizer import Lemmatizer from .syntax.parser import get_templates from .syntax import nonproj + from .pipeline import NeuralDependencyParser, EntityRecognizer from .pipeline import TokenVectorEncoder, NeuralTagger, NeuralEntityRecognizer from .pipeline import NeuralLabeller +from .pipeline import SimilarityHook + from .compat import json_dumps from .attrs import IS_STOP from .lang.punctuation import TOKENIZER_PREFIXES, TOKENIZER_SUFFIXES, TOKENIZER_INFIXES @@ -112,6 +115,7 @@ class BaseDefaults(object): nonproj.deprojectivize, ], 'entities': lambda nlp, **cfg: [NeuralEntityRecognizer(nlp.vocab, **cfg)], + 'similarity': lambda nlp, **cfg: [SimilarityHook(nlp.vocab, **cfg)] } token_match = TOKEN_MATCH