mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 18:26:30 +03:00
Update docstrings and types [ci skip]
This commit is contained in:
parent
b331653ade
commit
e697609fef
|
@ -138,7 +138,10 @@ class TextCategorizer(TrainablePipe):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def label_data(self) -> List[str]:
|
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
|
return self.labels
|
||||||
|
|
||||||
def pipe(self, stream: Iterable[Doc], *, batch_size: int = 128) -> Iterator[Doc]:
|
def pipe(self, stream: Iterable[Doc], *, batch_size: int = 128) -> Iterator[Doc]:
|
||||||
|
@ -176,7 +179,7 @@ class TextCategorizer(TrainablePipe):
|
||||||
return scores
|
return scores
|
||||||
|
|
||||||
def set_annotations(self, docs: Iterable[Doc], scores) -> None:
|
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.
|
docs (Iterable[Doc]): The documents to modify.
|
||||||
scores: The scores to set, produced by TextCategorizer.predict.
|
scores: The scores to set, produced by TextCategorizer.predict.
|
||||||
|
@ -330,7 +333,7 @@ class TextCategorizer(TrainablePipe):
|
||||||
nlp: Optional[Language] = None,
|
nlp: Optional[Language] = None,
|
||||||
labels: Optional[Dict] = None,
|
labels: Optional[Dict] = None,
|
||||||
positive_label: Optional[str] = None,
|
positive_label: Optional[str] = None,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize the pipe for training, using a representative set
|
"""Initialize the pipe for training, using a representative set
|
||||||
of data examples.
|
of data examples.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user