From 240dbdabc5a4c9dbd5f1ccc7c46ee704a9c8e4e7 Mon Sep 17 00:00:00 2001 From: Vinit Ravishankar Date: Fri, 17 Feb 2023 18:41:03 +0530 Subject: [PATCH] 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.