mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 01:04:34 +03:00
Add factory for experimental SimilarityHook component
This commit is contained in:
parent
d59fa32df1
commit
836bfa2d0f
|
@ -17,9 +17,12 @@ from .tagger import Tagger
|
||||||
from .lemmatizer import Lemmatizer
|
from .lemmatizer import Lemmatizer
|
||||||
from .syntax.parser import get_templates
|
from .syntax.parser import get_templates
|
||||||
from .syntax import nonproj
|
from .syntax import nonproj
|
||||||
|
|
||||||
from .pipeline import NeuralDependencyParser, EntityRecognizer
|
from .pipeline import NeuralDependencyParser, EntityRecognizer
|
||||||
from .pipeline import TokenVectorEncoder, NeuralTagger, NeuralEntityRecognizer
|
from .pipeline import TokenVectorEncoder, NeuralTagger, NeuralEntityRecognizer
|
||||||
from .pipeline import NeuralLabeller
|
from .pipeline import NeuralLabeller
|
||||||
|
from .pipeline import SimilarityHook
|
||||||
|
|
||||||
from .compat import json_dumps
|
from .compat import json_dumps
|
||||||
from .attrs import IS_STOP
|
from .attrs import IS_STOP
|
||||||
from .lang.punctuation import TOKENIZER_PREFIXES, TOKENIZER_SUFFIXES, TOKENIZER_INFIXES
|
from .lang.punctuation import TOKENIZER_PREFIXES, TOKENIZER_SUFFIXES, TOKENIZER_INFIXES
|
||||||
|
@ -112,6 +115,7 @@ class BaseDefaults(object):
|
||||||
nonproj.deprojectivize,
|
nonproj.deprojectivize,
|
||||||
],
|
],
|
||||||
'entities': lambda nlp, **cfg: [NeuralEntityRecognizer(nlp.vocab, **cfg)],
|
'entities': lambda nlp, **cfg: [NeuralEntityRecognizer(nlp.vocab, **cfg)],
|
||||||
|
'similarity': lambda nlp, **cfg: [SimilarityHook(nlp.vocab, **cfg)]
|
||||||
}
|
}
|
||||||
|
|
||||||
token_match = TOKEN_MATCH
|
token_match = TOKEN_MATCH
|
||||||
|
|
Loading…
Reference in New Issue
Block a user