From 86d3e78c641f99a0f249aa3ff14a61d4adab7c4a Mon Sep 17 00:00:00 2001 From: kadarakos Date: Mon, 20 Feb 2023 17:02:27 +0000 Subject: [PATCH] make label mapper private --- spacy/pipeline/spancat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/pipeline/spancat.py b/spacy/pipeline/spancat.py index 0a1caef90..1575abfa5 100644 --- a/spacy/pipeline/spancat.py +++ b/spacy/pipeline/spancat.py @@ -425,7 +425,7 @@ class SpanCategorizer(TrainablePipe): return list(self.labels) @property - def label_map(self) -> Dict[str, int]: + def _label_map(self) -> Dict[str, int]: """RETURNS (Dict[str, int]): The label map.""" return {label: i for i, label in enumerate(self.labels)} @@ -581,7 +581,7 @@ class SpanCategorizer(TrainablePipe): key = (gold_span.start, gold_span.end) if key in spans_index: row = spans_index[key] - k = self.label_map[gold_span.label_] + k = self._label_map[gold_span.label_] target[row, k] = 1.0 if self.add_negative_label: # delete negative label target.