mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-04 06:16:33 +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 |
||
---|---|---|
.. | ||
architectures.md | ||
attributeruler.md | ||
attributes.md | ||
cli.md | ||
corpus.md | ||
cython-classes.md | ||
cython-structs.md | ||
cython.md | ||
data-formats.md | ||
dependencymatcher.md | ||
dependencyparser.md | ||
doc.md | ||
docbin.md | ||
edittreelemmatizer.md | ||
entitylinker.md | ||
entityrecognizer.md | ||
entityruler.md | ||
example.md | ||
index.md | ||
kb.md | ||
language.md | ||
legacy.md | ||
lemmatizer.md | ||
lexeme.md | ||
lookups.md | ||
matcher.md | ||
morphologizer.md | ||
morphology.md | ||
phrasematcher.md | ||
pipe.md | ||
pipeline-functions.md | ||
scorer.md | ||
sentencerecognizer.md | ||
sentencizer.md | ||
span.md | ||
spancategorizer.md | ||
spangroup.md | ||
spanruler.md | ||
stringstore.md | ||
tagger.md | ||
textcategorizer.md | ||
tok2vec.md | ||
token.md | ||
tokenizer.md | ||
top-level.md | ||
transformer.md | ||
vectors.md | ||
vocab.md |