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.tree2label[tree_id] = len(self.cfg["labels"])
|
||||||
self.cfg["labels"].append(tree_id)
|
self.cfg["labels"].append(tree_id)
|
||||||
return self.tree2label[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):
|
def add_label(self, label):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@property
|
|
||||||
def activations(self):
|
|
||||||
return ["ents", "scores"]
|
|
||||||
|
|
||||||
def _add_doc_activations(
|
def _add_doc_activations(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
|
|
|
@ -205,7 +205,3 @@ class SentenceRecognizer(Tagger):
|
||||||
|
|
||||||
def add_label(self, label, values=None):
|
def add_label(self, label, values=None):
|
||||||
raise NotImplementedError
|
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]))
|
spans.append(Span(doc, start, end, label=labels[j]))
|
||||||
|
|
||||||
return spans
|
return spans
|
||||||
|
|
||||||
@property
|
|
||||||
def activations(self):
|
|
||||||
return ["indices", "scores"]
|
|
||||||
|
|
|
@ -338,8 +338,4 @@ class Tagger(TrainablePipe):
|
||||||
self._allow_extra_label()
|
self._allow_extra_label()
|
||||||
self.cfg["labels"].append(label)
|
self.cfg["labels"].append(label)
|
||||||
self.vocab.strings.add(label)
|
self.vocab.strings.add(label)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
@property
|
|
||||||
def activations(self):
|
|
||||||
return ["probs", "guesses"]
|
|
|
@ -416,7 +416,3 @@ class TextCategorizer(TrainablePipe):
|
||||||
for ex in examples:
|
for ex in examples:
|
||||||
if list(ex.reference.cats.values()).count(1.0) > 1:
|
if list(ex.reference.cats.values()).count(1.0) > 1:
|
||||||
raise ValueError(Errors.E895.format(value=ex.reference.cats))
|
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)
|
util.from_disk(path, deserialize, exclude)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
@property
|
|
||||||
def activations(self):
|
|
||||||
raise NotImplementedError(Errors.E931.format(parent="TrainablePipe", method="activations", name=self.name))
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def store_activations(self):
|
def store_activations(self):
|
||||||
return self._store_activations
|
return self._store_activations
|
||||||
|
|
|
@ -665,10 +665,4 @@ cdef class Parser(TrainablePipe):
|
||||||
golds.append(gold)
|
golds.append(gold)
|
||||||
if state.is_final():
|
if state.is_final():
|
||||||
break
|
break
|
||||||
return states, golds, max_length
|
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