Skip to content
Discussion options

You must be logged in to vote

Hi @AlexandreRozier , the reason why the code above doesn't work is because nlp.initialize() clears all the weights. In relation to this, you can check out the spacy assemble command and pass your config file. Under the hood, assemble does not initialize the components you've sourced.

You can also do this programmatically by disabling all the sourced components before calling the nlp.initialize() method:

with nlp.select_pipes(disable=[*sourced]):
    nlp.initialize()

Again, it may be easier to use the spacy assemble command, as it does this step for you. You can also check out its implementation to see how it creates the pipeline.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@AlexandreRozier
Comment options

@adrianeboyd
Comment options

@AlexandreRozier
Comment options

@AlexandreRozier
Comment options

Answer selected by AlexandreRozier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / morphologizer Feature: Morphologizer
3 participants
Converted from issue

This discussion was converted from issue #10279 on February 16, 2022 02:32.