How to use nlp.after_creation or nlp.after_pipeline_creation configs? #9653
Answered
by
adrianeboyd
kinghuang
asked this question in
Help: Coding & Implementations
-
I'm trying to set @registry.callbacks("entity_linker_overwrite_false")
def make_entity_linker_overwrite_false():
def entity_linker_overwrite_false(nlp):
if nlp.has_pipe("entity_linker"):
nlp.get_pipe("entity_linker").cfg["overwrite"] = False And, in my config file, set it for [nlp]
lang = "en"
pipeline = ["...","entity_linker","..."]
before_creation = null
after_creation = null
after_pipeline_creation = {"@callbacks": "entity_linker_overwrite_false"} The callback doesn't seem to work, though. It's never called, and the I've also tried putting the callback on |
Beta Was this translation helpful? Give feedback.
Answered by
adrianeboyd
Nov 10, 2021
Replies: 1 comment 1 reply
-
I think you might have forgotten to return the callback in the definition? @registry.callbacks("entity_linker_overwrite_false")
def make_entity_linker_overwrite_false():
def entity_linker_overwrite_false(nlp):
if nlp.has_pipe("entity_linker"):
nlp.get_pipe("entity_linker").cfg["overwrite"] = False
return entity_linker_overwrite_false |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
kinghuang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you might have forgotten to return the callback in the definition?