From 028e1cbc8cba01885071a66ac70b210d9f98a61a Mon Sep 17 00:00:00 2001 From: Vinit Ravishankar Date: Fri, 17 Feb 2023 18:40:55 +0530 Subject: [PATCH 1/2] Update website/docs/api/tagger.mdx Co-authored-by: Adriane Boyd --- website/docs/api/tagger.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/api/tagger.mdx b/website/docs/api/tagger.mdx index 2233a7794..293e3bda5 100644 --- a/website/docs/api/tagger.mdx +++ b/website/docs/api/tagger.mdx @@ -46,7 +46,7 @@ architectures and their arguments and hyperparameters. | `overwrite` 3.2 | Whether existing annotation is overwritten. Defaults to `False`. ~~bool~~ | | `scorer` 3.2 | The scoring method. Defaults to [`Scorer.score_token_attr`](/api/scorer#score_token_attr) for the attribute `"tag"`. ~~Optional[Callable]~~ | | `neg_prefix` 3.2.1 | The prefix used to specify incorrect tags while training. The tagger will learn not to predict exactly this tag. Defaults to `!`. ~~str~~ | -| `label_smoothing` 3.5 | Whether or not to use label smoothing. Defaults to `False`. ~~bool~~ | +| `label_smoothing` 3.6 | Whether or not to use label smoothing. Defaults to `False`. ~~bool~~ | ```python %%GITHUB_SPACY/spacy/pipeline/tagger.pyx From 240dbdabc5a4c9dbd5f1ccc7c46ee704a9c8e4e7 Mon Sep 17 00:00:00 2001 From: Vinit Ravishankar Date: Fri, 17 Feb 2023 18:41:03 +0530 Subject: [PATCH 2/2] Update spacy/pipeline/tagger.pyx Co-authored-by: Adriane Boyd --- spacy/pipeline/tagger.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/pipeline/tagger.pyx b/spacy/pipeline/tagger.pyx index ae59d0983..243657517 100644 --- a/spacy/pipeline/tagger.pyx +++ b/spacy/pipeline/tagger.pyx @@ -258,8 +258,8 @@ class Tagger(TrainablePipe): DOCS: https://spacy.io/api/tagger#get_loss """ validate_examples(examples, "Tagger.get_loss") - self.cfg["label_smoothing"] = 0.05 if self.cfg["label_smoothing"] else 0.0 - loss_func = SequenceCategoricalCrossentropy(names=self.labels, normalize=False, neg_prefix=self.cfg["neg_prefix"], label_smoothing=self.cfg["label_smoothing"]) + label_smoothing = 0.05 if self.cfg["label_smoothing"] else 0.0 + loss_func = SequenceCategoricalCrossentropy(names=self.labels, normalize=False, neg_prefix=self.cfg["neg_prefix"], label_smoothing=label_smoothing) # Convert empty tag "" to missing value None so that both misaligned # tokens and tokens with missing annotation have the default missing # value None.