[BUG]ValueError: [E090] Extension 'similarity' already exists on Span. To overwrite the existing extension, set `force=True` on `Span.set_extension`. #94
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))
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
onSpan.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 :)