From e697609fef16b58e314035221470868c4d1d586a Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Mon, 18 Jan 2021 22:31:26 +1100 Subject: [PATCH] Update docstrings and types [ci skip] --- spacy/pipeline/textcat.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spacy/pipeline/textcat.py b/spacy/pipeline/textcat.py index c09533319..79b6e8d38 100644 --- a/spacy/pipeline/textcat.py +++ b/spacy/pipeline/textcat.py @@ -138,7 +138,10 @@ class TextCategorizer(TrainablePipe): @property def label_data(self) -> List[str]: - """RETURNS (List[str]): Information about the component's labels.""" + """RETURNS (List[str]): Information about the component's labels. + + DOCS: https://nightly.spacy.io/api/textcategorizer#label_data + """ return self.labels def pipe(self, stream: Iterable[Doc], *, batch_size: int = 128) -> Iterator[Doc]: @@ -176,7 +179,7 @@ class TextCategorizer(TrainablePipe): return scores def set_annotations(self, docs: Iterable[Doc], scores) -> None: - """Modify a batch of [`Doc`](/api/doc) objects, using pre-computed scores. + """Modify a batch of Doc objects, using pre-computed scores. docs (Iterable[Doc]): The documents to modify. scores: The scores to set, produced by TextCategorizer.predict. @@ -330,7 +333,7 @@ class TextCategorizer(TrainablePipe): nlp: Optional[Language] = None, labels: Optional[Dict] = None, positive_label: Optional[str] = None, - ): + ) -> None: """Initialize the pipe for training, using a representative set of data examples.