Today, when you try to run a demo of Chatbot and create an entity, an error occurs:
Traceback (most recent call last):
File "c:/users/USER/desktop/bot.py", line 77, in <module>
chatbot = ChatBot('Ron Obvious')
File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\chatterbot.py", line 28, in __init__
self.storage = utils.initialize_class(storage_adapter, **kwargs)
File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\utils.py", line 33, in initialize_class
return Class(*args, **kwargs)
File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\storage\sql_storage.py", line 20, in __init__
super().__init__(**kwargs)
File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\storage\storage_adapter.py", line 21, in __init__
'tagger_language', languages.ENG
File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\tagging.py", line 13, in __init__
self.nlp = spacy.load(self.language.ISO_639_1.lower())
File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\spacy\__init__.py", line 47, in load
return util.load_model(name, disable=disable, exclude=exclude, config=config)
File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\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")
In fact, I feel that there is a conflict between packages. Spacyv3.0 will no longer support the simple reference of “en”, and I expect the full name of “en”_ core_ web_ SM “reference. Chatbot failed to follow up, and kept trying the deprecated shortcut such as “en” in the source code.
resolvent:
Enter the tagging.py module in the Chatbot package in the PY environment, and the sentence mentioned in the error message will be:
self.nlp = spacy.load(self.language.ISO_639_1.lower())
Change to:
if self.language.ISO_639_1.lower() == 'en':
self.nlp = spacy.load('en_core_web_sm')
else:
self.nlp = spacy.load(self.language.ISO_639_1.lower())
The problem is resolved after reloading.
Read More:
- AttributeError: Can‘t get attribute ‘LeNet‘ on <module ‘__ main__ “From (error in torch loading model)
- java.lang.IllegalArgumentException: error at ::0 can‘t find referenced pointcut anyMethod
- [Solved] CAP_IMAGES: can‘t find starting number (in the name of file)
- KeyError: “Can‘t open attribute (can‘t locate attribute: ‘nrx‘)“
- Python-cp950‘ codec can‘t encode
- Python2 PicklingError: Can‘t pickle <type ‘instancemethod‘>: attribute lookup __builtin__.instanceme
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX
- Can not start, can not find QT pligins “windows” problem after installing QT vs environment 2021-06-13
- Python error TypeError:can ‘t convert complex to float
- Error (12153): Can‘t elaborate top-level user hierarchy
- 2003 – Can‘t connect to MySQL server on ‘192.168.163.128‘(Unknown error )
- UnhandledPromiseRejectionWarning Error: Can‘t set headers after they are sent (How to Fix)
- AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘H:\\yolov5-5.0\\models\\
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX
- ERROR in Entry module not found Error Can t resolve
- ‘ascii‘ codec can‘t decode byte 0x90 in position 614: ordinal not in range(128)
- UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xc3 in position 54: invalid continuation byte
- Pycharm: cann‘t find declaration to go
- To solve this problem, we can’t find the solution of / storage / emulated / 0 / file. I can’t. You can try this
- Solving Linux minute warning: no support for locale: en_ US.utf