How do you apply a SpaCy project in practice? #11699
-
This has got to be such a stupid question but I cannot figure out how to load a package to actually use it once I have run a project workflow. I've read and re-read the documentation and just don't get it, sorry. I ran the training pipeline on this project: https://github.com/explosion/projects/tree/v3/tutorials/ner_tweets ( And I exported the package ( But I cannot load the package without errors. OSError: [E053] Could not read config file from ner_tweets/packages/en_ner_tweets-1.0.0/config.cfg
How do I actually add the model to the pipeline? 🙃 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @metalaureate , the tar output from the
Then you can load it into Python by passing the appropriate name in Since you ran the whole training process for import spacy
nlp = spacy.load("path/to/training/model-best") |
Beta Was this translation helpful? Give feedback.
Hi @metalaureate , the tar output from the
package
command creates an installable Python package. You need to install it first before loading:Then you can load it into Python by passing the appropriate name in
spacy.load
. To sanity-check if your environment has installed the pipeline, you can runpython -m spacy info
. You can see more from the docs.Since you ran the whole training process for
ner_tweets
, you can also load the model directly. Something like this: