Overwriting function get_alias_candidates for Entity Linking with Knowledge Base #11400
-
I'm trying to see if there is a way of currently overwriting the Knowledge Base get_alias_candidates function that is used for entity linking. The reason for doing so is to incorporate fuzzy matching in candidate generation. I came across the following page regarding this topic: But when using this format, I get an error that says "Unknown function registry: 'assets' ". I also tried overwriting the function directly, but this failed because the function is read-only. I've spent a while trying to search other parts of the documentation but haven't been able to find anything outlining how to go about it. Any help would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @nkaramooz! It's sufficient to modify the configuration for your entity linker so that the entry for The error sounds like you're trying to use a non-existent function registry - try using |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer! This worked though has created some downstream problems, which I am working through (mainly wishing it were easier to make a candidate object from an entity_id), but should be able to solve. Thanks for your time! |
Beta Was this translation helpful? Give feedback.
Hi @nkaramooz! It's sufficient to modify the configuration for your entity linker so that the entry for
get_candidates
references the correct function. This can be done programatically (see example in theEntityLinker
docs) or in your.yaml
config (see this NEL tutorial project).The error sounds like you're trying to use a non-existent function registry - try using
@spacy.registry.misc("WhateverYouWannaCallYourRegistryEntry.v1")
instead. In general, please always include a minimal reproducible example so that we can reproduce your issues.