Skip to content

[BUG]ValueError: [E090] Extension 'similarity' already exists on Span. To overwrite the existing extension, set force=True on Span.set_extension. #94

Open
@nitzanbar29

Description

@nitzanbar29

Describe the bug
Hi, I use the example in the demo.

I'm facing this error:

ValueError: [E090] Extension 'similarity' already exists on Span. To overwrite the existing extension, set force=True on Span.set_extension.

To Reproduce

common English pipeline

nlp = spacy.load('en_core_web_sm')

@Language.component('quickumls_component')
def quickumls_component(doc):
return SpacyQuickUMLS(nlp, umls_path1)(doc)

quickumls_component = SpacyQuickUMLS(nlp, umls_path1)
nlp.add_pipe('quickumls_component', last=True)

doc = nlp('Pt c/o shortness of breath, chest pain, nausea, vomiting, diarrrhea')

for ent in doc.ents:
print('Entity text : {}'.format(ent.text))
print('Label (UMLS CUI) : {}'.format(ent.label_))
print('Similarity : {}'.format(ent..similarity))
print('Semtypes : {}'.format(ent.
.semtypes))

**Environment **

  • OS: Unbuntu
  • QuickUMLS version 1.4.0
  • UMLS version 2023

Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions