From a88bfa4068506a079dcb08cc72a3f127c1a2707c Mon Sep 17 00:00:00 2001 From: John Giorgi Date: Thu, 27 Jul 2023 12:03:40 -0400 Subject: [PATCH] Drop umls and umls_ents attributes in linker Drop the umls and umls_ents attributes in the linker that were there for backwards compatibility --- scispacy/linking.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scispacy/linking.py b/scispacy/linking.py index b2bb117..641f419 100644 --- a/scispacy/linking.py +++ b/scispacy/linking.py @@ -80,8 +80,6 @@ def __init__( max_entities_per_mention: int = 5, linker_name: Optional[str] = None, ): - # TODO(Mark): Remove in scispacy v1.0. - Span.set_extension("umls_ents", default=[], force=True) Span.set_extension("kb_ents", default=[], force=True) self.candidate_generator = candidate_generator or CandidateGenerator( @@ -95,9 +93,6 @@ def __init__( self.filter_for_definitions = filter_for_definitions self.max_entities_per_mention = max_entities_per_mention - # TODO(Mark): Remove in scispacy v1.0. This is for backward compatability only. - self.umls = self.kb - def __call__(self, doc: Doc) -> Doc: mention_strings = [] if self.resolve_abbreviations and Doc.has_extension("abbreviations"): @@ -131,7 +126,6 @@ def __call__(self, doc: Doc) -> Doc: if score > self.threshold: predicted.append((cand.concept_id, score)) sorted_predicted = sorted(predicted, reverse=True, key=lambda x: x[1]) - mention._.umls_ents = sorted_predicted[: self.max_entities_per_mention] mention._.kb_ents = sorted_predicted[: self.max_entities_per_mention] return doc