Skip to content
Discussion options

You must be logged in to vote

You want to load it like this:

import spacy
nlp = spacy.load("training/model-best")

# usually you just want to run the whole pipeline
doc = nlp("This is a text.")

# if you want to inspect the component for some reason
textcat = nlp.get_pipe("textcat")

You don't want to load individual components like this because you're missing the configuration from config.cfg and the shared vocab from the top-level directory in the saved pipeline (training/model-best). For more details, have a look at: https://spacy.io/usage/processing-pipelines#pipelines

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@1danjordan
Comment options

@adrianeboyd
Comment options

@1danjordan
Comment options

Answer selected by svlandeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / serialize Feature: Serialization, saving and loading
2 participants
Converted from issue

This discussion was converted from issue #9303 on September 28, 2021 06:47.