Remove TrainablePipe.activations

We do not need to enumerate the activations anymore since `store_activations` is
`bool`.
This commit is contained in:
Daniël de Kok 2022-08-29 16:47:13 +02:00
parent aea53378dc
commit 8c2652d788
8 changed files with 2 additions and 36 deletions

View File

@ -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"]

View File

@ -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,
*,

View File

@ -205,7 +205,3 @@ class SentenceRecognizer(Tagger):
def add_label(self, label, values=None):
raise NotImplementedError
@property
def activations(self):
return ["probs", "guesses"]

View File

@ -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"]

View File

@ -338,8 +338,4 @@ class Tagger(TrainablePipe):
self._allow_extra_label()
self.cfg["labels"].append(label)
self.vocab.strings.add(label)
return 1
@property
def activations(self):
return ["probs", "guesses"]
return 1

View File

@ -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"]

View File

@ -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

View File

@ -665,10 +665,4 @@ cdef class Parser(TrainablePipe):
golds.append(gold)
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 []
return states, golds, max_length