From 29f156aa1ae63e3703dbb5b5e4e40eddb42cdfe1 Mon Sep 17 00:00:00 2001 From: Lj Miranda <12949683+ljvmiranda921@users.noreply.github.com> Date: Tue, 29 Nov 2022 11:06:35 +0800 Subject: [PATCH] Update documentation Update grammar and usage Co-authored-by: Adriane Boyd --- spacy/pipeline/spancat_exclusive.py | 6 +++--- website/docs/api/spancategorizer.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spacy/pipeline/spancat_exclusive.py b/spacy/pipeline/spancat_exclusive.py index adf3741c1..595e608df 100644 --- a/spacy/pipeline/spancat_exclusive.py +++ b/spacy/pipeline/spancat_exclusive.py @@ -64,7 +64,7 @@ def make_spancat( allow_overlap: bool = True, ) -> "Exclusive_SpanCategorizer": """Create a SpanCategorizerExclusive component. The span categorizer consists of two - parts: a suggester function that proposes candidate spans, and a labeller + parts: a suggester function that proposes candidate spans, and a labeler model that predicts a single label for each span. suggester (Callable[[Iterable[Doc], Optional[Ops]], Ragged]): A function that suggests spans. @@ -81,7 +81,7 @@ def make_spancat( Scorer.score_spans for the Doc.spans[spans_key] with overlapping spans allowed. negative_weight (float): Multiplier for the loss terms. - Can be used to down weigh the negative samples if there are too many. + Can be used to downweight the negative samples if there are too many. allow_overlap (bool): If True the data is assumed to contain overlapping spans. """ @@ -100,7 +100,7 @@ def make_spancat( @dataclass class Ranges: """ - Helper class help avoid storing overlapping span. + Helper class to avoid storing overlapping spans. """ def __init__(self): diff --git a/website/docs/api/spancategorizer.md b/website/docs/api/spancategorizer.md index 940bcf699..119cdb1da 100644 --- a/website/docs/api/spancategorizer.md +++ b/website/docs/api/spancategorizer.md @@ -87,8 +87,8 @@ architectures and their arguments and hyperparameters. | `threshold` | Minimum probability to consider a prediction positive. Spans with a positive prediction will be saved on the Doc. Defaults to `0.5`. ~~float~~ | | `max_positive` | Maximum number of labels to consider positive per span. Defaults to `None`, indicating no limit. ~~Optional[int]~~ | | `scorer` | The scoring method. Defaults to [`Scorer.score_spans`](/api/scorer#score_spans) for `Doc.spans[spans_key]` with overlapping spans allowed. ~~Optional[Callable]~~ | -| `negative_weight` | Multiplier for the loss terms. It can be used to down weigh the negative samples if there are too many. It is only available when using the `spancat_exclusive` component. ~~float~~ | -| `allow_overlap` | If `True`, the data is assumed to contain overlapping spans. It is only available when using the `spancat_exclusive` component. ~~bool~~ | +| `negative_weight` | Multiplier for the loss terms. It can be used to downweight the negative samples if there are too many. It is only available for the `spancat_exclusive` component. ~~float~~ | +| `allow_overlap` | If `True`, the data is assumed to contain overlapping spans. It is only available for the `spancat_exclusive` component. ~~bool~~ | @@ -106,7 +106,7 @@ architectures and their arguments and hyperparameters. > > ```python > # Construction via add_pipe with default model -> # Use 'spancat_exclusive' for exclusive clases +> # Use 'spancat_exclusive' for exclusive classes > spancat = nlp.add_pipe("spancat") > > # Construction via add_pipe with custom model