mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 09:56:28 +03:00
efdbb722c5
* Store activations in Doc when `store_activations` is enabled This change adds the new `activations` attribute to `Doc`. This attribute can be used by trainable pipes to store their activations, probabilities, and guesses for downstream users. As an example, this change modifies the `tagger` and `senter` pipes to add an `store_activations` option. When this option is enabled, the probabilities and guesses are stored in `set_annotations`. * Change type of `store_activations` to `Union[bool, List[str]]` When the value is: - A bool: all activations are stored when set to `True`. - A List[str]: the activations named in the list are stored * Formatting fixes in Tagger * Support store_activations in spancat and morphologizer * Make Doc.activations type visible to MyPy * textcat/textcat_multilabel: add store_activations option * trainable_lemmatizer/entity_linker: add store_activations option * parser/ner: do not currently support returning activations * Extend tagger and senter tests So that they, like the other tests, also check that we get no activations if no activations were requested. * Document `Doc.activations` and `store_activations` in the relevant pipes * Start errors/warnings at higher numbers to avoid merge conflicts Between the master and v4 branches. * Add `store_activations` to docstrings. * Replace store_activations setter by set_store_activations method Setters that take a different type than what the getter returns are still problematic for MyPy. Replace the setter by a method, so that type inference works everywhere. * Use dict comprehension suggested by @svlandeg * Revert "Use dict comprehension suggested by @svlandeg" This reverts commit |
||
---|---|---|
.. | ||
_edit_tree_internals | ||
_parser_internals | ||
legacy | ||
__init__.py | ||
attribute_ruler.py | ||
dep_parser.pyx | ||
edit_tree_lemmatizer.py | ||
entity_linker.py | ||
entity_ruler.py | ||
functions.py | ||
lemmatizer.py | ||
morphologizer.pyx | ||
multitask.pyx | ||
ner.pyx | ||
pipe.pxd | ||
pipe.pyi | ||
pipe.pyx | ||
sentencizer.pyx | ||
senter.pyx | ||
span_ruler.py | ||
spancat.py | ||
tagger.pyx | ||
textcat_multilabel.py | ||
textcat.py | ||
tok2vec.py | ||
trainable_pipe.pxd | ||
trainable_pipe.pyx | ||
transition_parser.pxd | ||
transition_parser.pyx |