Skip to content

Commit

Permalink
Merge pull request #489 from JohnGiorgi/drop-old-umls-arg
Browse files Browse the repository at this point in the history
Drop umls and umls_ents attributes in linker
  • Loading branch information
dakinggg authored Sep 13, 2023
2 parents 2081f77 + 56048a2 commit 23f443f
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions scispacy/linking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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"):
Expand Down Expand Up @@ -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

0 comments on commit 23f443f

Please sign in to comment.