mirror of
https://github.com/explosion/spaCy.git
synced 2025-03-10 14:25:49 +03:00
Remove TrainablePipe.activations
We do not need to enumerate the activations anymore since `store_activations` is `bool`.
This commit is contained in:
parent
aea53378dc
commit
8c2652d788
|
@ -394,7 +394,3 @@ class EditTreeLemmatizer(TrainablePipe):
|
|||
self.tree2label[tree_id] = len(self.cfg["labels"])
|
||||
self.cfg["labels"].append(tree_id)
|
||||
return self.tree2label[tree_id]
|
||||
|
||||
@property
|
||||
def activations(self):
|
||||
return ["probs", "guesses"]
|
||||
|
|
|
@ -656,10 +656,6 @@ class EntityLinker(TrainablePipe):
|
|||
def add_label(self, label):
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
def activations(self):
|
||||
return ["ents", "scores"]
|
||||
|
||||
def _add_doc_activations(
|
||||
self,
|
||||
*,
|
||||
|
|
|
@ -205,7 +205,3 @@ class SentenceRecognizer(Tagger):
|
|||
|
||||
def add_label(self, label, values=None):
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
def activations(self):
|
||||
return ["probs", "guesses"]
|
||||
|
|
|
@ -493,7 +493,3 @@ class SpanCategorizer(TrainablePipe):
|
|||
spans.append(Span(doc, start, end, label=labels[j]))
|
||||
|
||||
return spans
|
||||
|
||||
@property
|
||||
def activations(self):
|
||||
return ["indices", "scores"]
|
||||
|
|
|
@ -339,7 +339,3 @@ class Tagger(TrainablePipe):
|
|||
self.cfg["labels"].append(label)
|
||||
self.vocab.strings.add(label)
|
||||
return 1
|
||||
|
||||
@property
|
||||
def activations(self):
|
||||
return ["probs", "guesses"]
|
||||
|
|
|
@ -416,7 +416,3 @@ class TextCategorizer(TrainablePipe):
|
|||
for ex in examples:
|
||||
if list(ex.reference.cats.values()).count(1.0) > 1:
|
||||
raise ValueError(Errors.E895.format(value=ex.reference.cats))
|
||||
|
||||
@property
|
||||
def activations(self):
|
||||
return ["probs"]
|
||||
|
|
|
@ -344,10 +344,6 @@ cdef class TrainablePipe(Pipe):
|
|||
util.from_disk(path, deserialize, exclude)
|
||||
return self
|
||||
|
||||
@property
|
||||
def activations(self):
|
||||
raise NotImplementedError(Errors.E931.format(parent="TrainablePipe", method="activations", name=self.name))
|
||||
|
||||
@property
|
||||
def store_activations(self):
|
||||
return self._store_activations
|
||||
|
|
|
@ -666,9 +666,3 @@ cdef class Parser(TrainablePipe):
|
|||
if state.is_final():
|
||||
break
|
||||
return states, golds, max_length
|
||||
|
||||
@property
|
||||
def activations(self):
|
||||
# We currently do not have access to the state ids or probabilities
|
||||
# after parsing. TODO: the parser refactor does provide some history.
|
||||
return []
|
||||
|
|
Loading…
Reference in New Issue
Block a user