From baa3d81c3518e9e81bd6bc89382fca1d6c727f33 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 22 Jul 2017 01:13:36 +0200 Subject: [PATCH] Add text categorizer to Language --- spacy/language.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index bd90fa395..dcdfd7847 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -22,6 +22,7 @@ from .pipeline import NeuralDependencyParser, EntityRecognizer from .pipeline import TokenVectorEncoder, NeuralTagger, NeuralEntityRecognizer from .pipeline import NeuralLabeller from .pipeline import SimilarityHook +from .pipeline import TextCategorizer from .compat import json_dumps from .attrs import IS_STOP @@ -107,6 +108,8 @@ class BaseDefaults(object): NeuralDependencyParser(nlp.vocab, **cfg), nonproj.deprojectivize], 'ner': lambda nlp, **cfg: [NeuralEntityRecognizer(nlp.vocab, **cfg)], + 'similarity': lambda nlp, **cfg: [SimilarityHook(nlp.vocab, **cfg)], + 'textcat': lambda nlp, **cfg: [TextCategorizer(nlp.vocab, **cfg)], # Temporary compatibility -- delete after pivot 'token_vectors': lambda nlp, **cfg: [TokenVectorEncoder(nlp.vocab, **cfg)], 'tags': lambda nlp, **cfg: [NeuralTagger(nlp.vocab, **cfg)], @@ -115,7 +118,6 @@ 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