question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EntityLinker returns different CUIs with every run

See original GitHub issue

Hi,

I’m running into a weird issue with NER extraction.

Different runs on the same document gives me identical entities, but different CUIs. I noticed the EntityLinker guide says it uses an approximate nearest neighbor search while linking entities to the KB.

This is the config I’m using:

linker = EntityLinker(resolve_abbreviations=True, name="umls", max_entities_per_mention=1, k=1)

Configuration:

>>> spacy.__version__
'2.3.4'
>>> scispacy.__version__
'0.3.0'

Question: How do I make the results deterministic?

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
mnhcorpcommented, Feb 23, 2021

Yup, that works - thanks again!

0reactions
dakingggcommented, Feb 17, 2021

ahh, i see. As a work around, i think you can do something like this, after loading the entity linker on just the core model

linker = model['core'].get_pipe('scispacy_linker')
doc = linker(model['bc5cdr'](text))

I’m not sure if there is a way to add a pipe without creating a copy of it in spacy3, will have to look into it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EntityLinker knowledge base returns CUIs not MeSH IDs ...
I'm using scispaCy entity linker using this snippet: from scispacy.linking import EntityLinker import spacy, scispacy config ...
Read more >
EntityLinker · spaCy API Documentation
An EntityLinker component disambiguates textual mentions (tagged as named entities) ... it should return a single array, with one row per item in...
Read more >
Incorrect entity being returned by EntityLinker Spacy
The way the Entity Linker works is that, given all potential candidates for an entity, it picks the most likely one.
Read more >
ML4LHS/clinspacy source - Rdrr.io
This function is optional to run but gives you more #' control over the ... clinspacy_env$nlp$remove_pipe('EntityLinker') return(invisible()) } else ...
Read more >
spacy-entity-linker - PyPI
Spacy Entity Linker is a pipeline for spaCy that performs Linked Entity Extraction ... returns all entities in the whole document all_linked_entities =...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found