mirror of
https://github.com/explosion/spaCy.git
synced 2025-12-09 11:14:21 +03:00
* 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 |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_analysis.py | ||
| test_annotates_on_update.py | ||
| test_attributeruler.py | ||
| test_edit_tree_lemmatizer.py | ||
| test_entity_linker.py | ||
| test_entity_ruler.py | ||
| test_functions.py | ||
| test_initialize.py | ||
| test_lemmatizer.py | ||
| test_models.py | ||
| test_morphologizer.py | ||
| test_pipe_factories.py | ||
| test_pipe_methods.py | ||
| test_sentencizer.py | ||
| test_senter.py | ||
| test_span_ruler.py | ||
| test_spancat.py | ||
| test_tagger.py | ||
| test_textcat.py | ||
| test_tok2vec.py | ||