From 403b1f1312f61fa6d4045a2b42700a524eaac7eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danie=CC=88l=20de=20Kok?= Date: Wed, 6 Jul 2022 16:15:13 +0200 Subject: [PATCH] Add `store_activations` to docstrings. --- spacy/pipeline/edit_tree_lemmatizer.py | 2 ++ spacy/pipeline/entity_linker.py | 2 ++ spacy/pipeline/morphologizer.pyx | 2 ++ spacy/pipeline/senter.pyx | 2 ++ spacy/pipeline/spancat.py | 2 ++ spacy/pipeline/tagger.pyx | 2 ++ spacy/pipeline/textcat.py | 2 ++ spacy/pipeline/textcat_multilabel.py | 2 ++ 8 files changed, 16 insertions(+) diff --git a/spacy/pipeline/edit_tree_lemmatizer.py b/spacy/pipeline/edit_tree_lemmatizer.py index 7dd623246..8d7d7a1d0 100644 --- a/spacy/pipeline/edit_tree_lemmatizer.py +++ b/spacy/pipeline/edit_tree_lemmatizer.py @@ -109,6 +109,8 @@ class EditTreeLemmatizer(TrainablePipe): frequency in the training data. overwrite (bool): overwrite existing lemma annotations. top_k (int): try to apply at most the k most probable edit trees. + store_activations (Union[bool, List[str]]): Model activations to store in + Doc when annotating. supported activations are: "probs" and "guesses". """ self.vocab = vocab self.model = model diff --git a/spacy/pipeline/entity_linker.py b/spacy/pipeline/entity_linker.py index 184c98fb6..b48aef1c0 100644 --- a/spacy/pipeline/entity_linker.py +++ b/spacy/pipeline/entity_linker.py @@ -98,6 +98,8 @@ def make_entity_linker( get_candidates (Callable[[KnowledgeBase, "Span"], Iterable[Candidate]]): Function that produces a list of candidates, given a certain knowledge base and a textual mention. scorer (Optional[Callable]): The scoring method. + store_activations (Union[bool, List[str]]): Model activations to store in + Doc when annotating. supported activations are: "ents" and "scores". """ if not model.attrs.get("include_span_maker", False): diff --git a/spacy/pipeline/morphologizer.pyx b/spacy/pipeline/morphologizer.pyx index 882de3cd0..9e425e735 100644 --- a/spacy/pipeline/morphologizer.pyx +++ b/spacy/pipeline/morphologizer.pyx @@ -114,6 +114,8 @@ class Morphologizer(Tagger): scorer (Optional[Callable]): The scoring method. Defaults to Scorer.score_token_attr for the attributes "pos" and "morph" and Scorer.score_token_attr_per_feat for the attribute "morph". + store_activations (Union[bool, List[str]]): Model activations to store in + Doc when annotating. supported activations are: "probs" and "guesses". DOCS: https://spacy.io/api/morphologizer#init """ diff --git a/spacy/pipeline/senter.pyx b/spacy/pipeline/senter.pyx index 6f9b57196..53664d7ac 100644 --- a/spacy/pipeline/senter.pyx +++ b/spacy/pipeline/senter.pyx @@ -92,6 +92,8 @@ class SentenceRecognizer(Tagger): losses during training. scorer (Optional[Callable]): The scoring method. Defaults to Scorer.score_spans for the attribute "sents". + store_activations (Union[bool, List[str]]): Model activations to store in + Doc when annotating. supported activations are: "probs" and "guesses". DOCS: https://spacy.io/api/sentencerecognizer#init """ diff --git a/spacy/pipeline/spancat.py b/spacy/pipeline/spancat.py index a1bce5f5e..de8375303 100644 --- a/spacy/pipeline/spancat.py +++ b/spacy/pipeline/spancat.py @@ -141,6 +141,8 @@ def make_spancat( 0.5. max_positive (Optional[int]): Maximum number of labels to consider positive per span. Defaults to None, indicating no limit. + store_activations (Union[bool, List[str]]): Model activations to store in + Doc when annotating. supported activations are: "indices" and "scores". """ return SpanCategorizer( nlp.vocab, diff --git a/spacy/pipeline/tagger.pyx b/spacy/pipeline/tagger.pyx index 548e895ee..3430070da 100644 --- a/spacy/pipeline/tagger.pyx +++ b/spacy/pipeline/tagger.pyx @@ -107,6 +107,8 @@ class Tagger(TrainablePipe): losses during training. scorer (Optional[Callable]): The scoring method. Defaults to Scorer.score_token_attr for the attribute "tag". + store_activations (Union[bool, List[str]]): Model activations to store in + Doc when annotating. supported activations are: "probs" and "guesses". DOCS: https://spacy.io/api/tagger#init """ diff --git a/spacy/pipeline/textcat.py b/spacy/pipeline/textcat.py index 3e015de07..201c1fccd 100644 --- a/spacy/pipeline/textcat.py +++ b/spacy/pipeline/textcat.py @@ -107,6 +107,8 @@ def make_textcat( scores for each category. threshold (float): Cutoff to consider a prediction "positive". scorer (Optional[Callable]): The scoring method. + store_activations (Union[bool, List[str]]): Model activations to store in + Doc when annotating. supported activations is: "probs". """ return TextCategorizer( nlp.vocab, diff --git a/spacy/pipeline/textcat_multilabel.py b/spacy/pipeline/textcat_multilabel.py index 1bb817054..620a12f02 100644 --- a/spacy/pipeline/textcat_multilabel.py +++ b/spacy/pipeline/textcat_multilabel.py @@ -155,6 +155,8 @@ class MultiLabel_TextCategorizer(TextCategorizer): name (str): The component instance name, used to add entries to the losses during training. threshold (float): Cutoff to consider a prediction "positive". + store_activations (Union[bool, List[str]]): Model activations to store in + Doc when annotating. supported activations is: "probs". DOCS: https://spacy.io/api/textcategorizer#init """