How and where... load???? #7024
-
I Download and installation successful many times.... How and where... I load... You can now load the package via spacy.load('es_core_news_sm') I have spanish too... python -m spacy download es_core_news_sm ================= Installed pipeline packages (spaCy v3.0.1) ================= NAME SPACY VERSION How to reproduce the problem ........
In ssh....
python test2app.py
Traceback (most recent call last):
File "test2app.py", line 7, in <module>
chatbot = ChatBot('Ron Obvious')
File "/home/interco3/virtualenv/tonitest/3.7/lib/python3.7/site-packages/chatterbot/chatterbot.py", line 28, in __init__
self.storage = utils.initialize_class(storage_adapter, **kwargs)
File "/home/interco3/virtualenv/tonitest/3.7/lib/python3.7/site-packages/chatterbot/utils.py", line 33, in initialize_class
return Class(*args, **kwargs)
File "/home/interco3/virtualenv/tonitest/3.7/lib/python3.7/site-packages/chatterbot/storage/sql_storage.py", line 20, in __init__
super().__init__(**kwargs)
File "/home/interco3/virtualenv/tonitest/3.7/lib/python3.7/site-packages/chatterbot/storage/storage_adapter.py", line 21, in __init__
'tagger_language', languages.ENG
File "/home/interco3/virtualenv/tonitest/3.7/lib/python3.7/site-packages/chatterbot/tagging.py", line 21, in __init__
self.nlp = spacy.load(self.language.ISO_639_1.lower())
File "/home/interco3/virtualenv/tonitest/3.7/lib/python3.7/site-packages/spacy/__init__.py", line 47, in load
return util.load_model(name, disable=disable, exclude=exclude, config=config)
File "/home/interco3/virtualenv/tonitest/3.7/lib/python3.7/site-packages/spacy/util.py", line 328, in load_model
raise IOError(Errors.E941.format(name=name, full=OLD_MODEL_SHORTCUTS[name]))
OSError: [E941] Can't find model 'en'. It looks like you're trying to load a model from a shortcut, which is deprecated as of spaCy v3.0. To load the model, use its full name instead:
nlp = spacy.load("en_core_web_sm")
For more details on the available models, see the models directory: https://spacy.io/models. If you want to create a blank model, use spacy.blank: nlp = spacy.blank("en")
(Xxxxxx:3.7)[xxxxxx@xxxx xxxxxx]$
Thanks a lot. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi! I've moved your question to the discussion board 🙂 The problem here seems to be that Chatterbot hard-codes So this is something that needs to be updated by Chatterbot in the future to support the new spaCy v3. In the meantime, you can install spaCy v2 that still supports the shortcuts:
|
Beta Was this translation helpful? Give feedback.
Hi! I've moved your question to the discussion board 🙂
The problem here seems to be that Chatterbot hard-codes
spacy.load("en")
in its code, specifically inchatterbot/tagging.py
. In spaCy v3, loading a model from a shortcut likeen
is deprecated, because this usage is misleading: there are many differenten
ores
models, so it should always be clear which package is being loaded. For example,en_core_web_sm
ores_core_web_sm
.So this is something that needs to be updated by Chatterbot in the future to support the new spaCy v3.
In the meantime, you can install spaCy v2 that still supports the shortcuts: