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

Support for spacy v3.0 #3

Open
fcggamou opened this issue Oct 14, 2020 · 4 comments
Open

Support for spacy v3.0 #3

fcggamou opened this issue Oct 14, 2020 · 4 comments
Labels
question Further information is requested

Comments

@fcggamou
Copy link

Hi,

Thanks a lot for the great work. Would this work with the upcoming version of Spacy 3.0?

Thanks!

@fcggamou fcggamou added the question Further information is requested label Oct 14, 2020
@svlandeg
Copy link

I would be happy to help support v3 compatibility. In the spaCy code, there are two relevant places:
https://github.com/explosion/spaCy/blob/develop/spacy/pipeline/entity_linker.py#L51 defines the current default candidate generator:

"get_candidates": {"@misc": "spacy.CandidateGenerator.v1"}

and set_kb() lets you load a custom KB from a given vocab: https://github.com/explosion/spaCy/blob/develop/spacy/pipeline/entity_linker.py#L146. This function is also called from entity_linker.initialize().

In the config, those settings can be defined as such:

[components.entity_linker]
factory = "entity_linker"
entity_vector_length = 64
get_candidates = {"@misc":"spacy.CandidateGenerator.v1"}
incl_context = true
incl_prior = true
labels_discard = []

[components.entity_linker.model]
@architectures = "spacy.EntityLinker.v1"
nO = null

[components.entity_linker.model.tok2vec]
@architectures = "spacy.HashEmbedCNN.v1"
...

[initialize.components.entity_linker.kb_loader]
@misc = "spacy.KBFromFile.v1"
kb_path = ${paths.kb}

So basically, you'd need to somehow implement those custom functions, then register them with spaCy, and they should become available in the config.

@kabirkhan
Copy link
Contributor

Sorry for the late reply on this. spaCy v3 is in progress now, hoping to have support in the next couple weeks. @svlandeg thanks for the offer to help. I'd actually love to do the implementation myself to get into the details of spaCy v3 internals but I will absolutely reach out if I have questions.

@Ibrokhimsadikov
Copy link

Hello @kabirkhan,

Is spacy v3 supported now?

@XBeg9
Copy link

XBeg9 commented Jan 27, 2022

Any updates here, would love to help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants