Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entity-linking for other ontologies #331

Open
BlakeList opened this issue Mar 10, 2021 · 6 comments
Open

Entity-linking for other ontologies #331

BlakeList opened this issue Mar 10, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@BlakeList
Copy link

Hey there!

Firstly, thank you so much for all the hard work you all have put into scispacy! I really appreciate the addition of the transformer and entity-linking.

While I have experience using spacy for ner and rel, I am quite new to ontologies and building spacy entity-linkers/knowledge bases. Would it be possible to get another ontology (specifically, https://github.com/Planteome/plant-trait-ontology) added? Or a tutorial/description of how I could do this myself?

Thank you again,
Blake

@dakinggg
Copy link
Collaborator

@DeNeutoy could you point to how to add a new entity linker?

@DeNeutoy
Copy link
Contributor

Hi @BlakeList,

Creating your own entity linker is quite straightforward - there is one fiddly bit in how the linkers are registered with scispacy at the moment which is less than ideal, but you should be able to follow the instructions in this issue:

#237

You can use this script:
https://github.com/allenai/scispacy/blob/master/scripts/create_linker.py

to create the files for the linker. The only input you need is a json/jsonl file with objects which look like this class:

class Entity(NamedTuple):

Once you've generated the linker and tested it out, we can see about getting it integrated into scispacy, if you think it would be useful!

@BlakeList
Copy link
Author

Great! Thank you @DeNeutoy

Feel free to close 👍

@DeNeutoy
Copy link
Contributor

@BlakeList did you get it working? Let us know if everything worked well for you!

@dakinggg dakinggg added the enhancement New feature or request label Mar 24, 2021
@BlakeList
Copy link
Author

Hi @DeNeutoy,

Sorry for the slow response, I am currently going down an alternative route.
I have instead built an entity-ruler (and now an ner model using prodigy + spacy). The code above is quite straightforward, however, I was having some troubles understanding how ontology classes can be used with the umls format.

Is there a standard approach to convert between ontology rdfs to umls? Can ontology classes (e.g. TO:0000387 for plant trait) be used as the concept id?

Cheers,
Blake

@viraj-lakshitha
Copy link

viraj-lakshitha commented Nov 21, 2022

Hi @BlakeList,

Creating your own entity linker is quite straightforward - there is one fiddly bit in how the linkers are registered with scispacy at the moment which is less than ideal, but you should be able to follow the instructions in this issue:

#237

You can use this script: https://github.com/allenai/scispacy/blob/master/scripts/create_linker.py

to create the files for the linker. The only input you need is a json/jsonl file with objects which look like this class:

class Entity(NamedTuple):

Once you've generated the linker and tested it out, we can see about getting it integrated into scispacy, if you think it would be useful!

Hi @DeNeutoy ,

I'm a bit confused! Are you able to provide a sample codebase that was used to create an entity linker component with a custom ontology and relevant resources?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants