Skip to content

Component 'relation_extractor' could not be run. Did you forget to call initialize()? #12992

Discussion options

You must be logged in to vote

When you are adding the new pipe to the existing pipeline:

nlp = spacy.load("en_core_web_sm")
nlp.add_pipe("relation_extractor", config=rel_config)

the model of the relation_extractor pipe has not been initialized yet. So, you need to do something along the lines of:

nlp = spacy.load("en_core_web_sm")
relation_extractor = nlp.add_pipe("relation_extractor", config=rel_config)
relation_extractor.initialize(lamda: examples)

where examples is a list of training examples (List[Example]). Also see: https://spacy.io/api/pipe#initialize

An unrelated tip about your configuration:

[components.relation_extractor.model.create_instance_tensor.tok2vec]
@architectures = "spacy.Tok2VecListener.v1"
widt…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@V20936181
Comment options

Answer selected by V20936181
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
training Training and updating models feat / pipeline Feature: Processing pipeline and components
2 participants