Georgetown-IR-Lab / QuickUMLS

System for Medical Concept Extraction and Linking
MIT License
369 stars 95 forks source link

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

Open nitzanbar29 opened 8 months ago

nitzanbar29 commented 8 months ago

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

Thanks :)

rmalla1 commented 5 months ago

I am facing the same issue.

JuneHou commented 3 months ago

Got the same error code here.

msegar commented 1 month ago

Same issue