When I try to package and install a newly-trained textcat model and if I give it a name with a hyphen in it, I can’t figure out how to import
the resulting package.
$ python -m spacy package ./models/ /tmp/ --meta example_meta.json --force --create-meta`
Model name (default: core_web_sm): jbmpp-3label
...
$ python setup.py sdist`
$ pip install en_jbmpp-3label-2.0.0.tar.gz # succeeds
$ python -c "import spacy; spacy.load('en_jbmpp_3label')"
ModuleNotFoundError: No module named 'en_jbmpp_3label'
$ python -c "import spacy; spacy.load('en_jbmpp-3label')"
ModuleNotFoundError: No module named 'en_jbmpp-3label'
$ python -c "import spacy; spacy.load('en-jbmpp-3label')"
ModuleNotFoundError: No module named 'en-jbmpp-3label'
When I go through the exact same workflow, but with a model name that doesn’t have a hyphen in it (e.g. jbmpp3label
), everything works correctly.
I think this is a bug – albeit a small one and one that’s easy to work around – but I wanted to alert you to it. It threw me off for 20 minutes or so and wanted to (a) give the solution some google juice and (b) give you all a chance to fix it when you can.
It’s also possible I missing something.
Prodigy is super helpful, amazing software that’s sped me up significantly. Thank you!