Rename BaseThincComponent --> Pipe

This commit is contained in:
Matthew Honnibal 2017-10-26 12:40:40 +02:00
parent b0f3ea2200
commit a8abc47811

View File

@ -83,7 +83,7 @@ class SentenceSegmenter(object):
yield doc[start : len(doc)] yield doc[start : len(doc)]
class BaseThincComponent(object): class Pipe(object):
name = None name = None
@classmethod @classmethod
@ -214,7 +214,7 @@ def _load_cfg(path):
return {} return {}
class Tensorizer(BaseThincComponent): class Tensorizer(Pipe):
"""Assign position-sensitive vectors to tokens, using a CNN or RNN.""" """Assign position-sensitive vectors to tokens, using a CNN or RNN."""
name = 'tensorizer' name = 'tensorizer'
@ -326,7 +326,7 @@ class Tensorizer(BaseThincComponent):
link_vectors_to_models(self.vocab) link_vectors_to_models(self.vocab)
class Tagger(BaseThincComponent): class Tagger(Pipe):
name = 'tagger' name = 'tagger'
def __init__(self, vocab, model=True, **cfg): def __init__(self, vocab, model=True, **cfg):
self.vocab = vocab self.vocab = vocab
@ -623,7 +623,7 @@ class MultitaskObjective(Tagger):
return '%s-%s' % (tags[i], ents[i]) return '%s-%s' % (tags[i], ents[i])
class SimilarityHook(BaseThincComponent): class SimilarityHook(Pipe):
""" """
Experimental Experimental
@ -675,7 +675,7 @@ class SimilarityHook(BaseThincComponent):
link_vectors_to_models(self.vocab) link_vectors_to_models(self.vocab)
class TextCategorizer(BaseThincComponent): class TextCategorizer(Pipe):
name = 'textcat' name = 'textcat'
@classmethod @classmethod