-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chatterbot 1.0.8 incompatible with spacy 3.0.0 #2120
Comments
Well... I talk whit spacy and tell me that. . The problem here seems to be that Chatterbot hard-codes spacy.load("en") in its code, specifically in chatterbot/tagging.py. In spaCy v3, loading a model from a shortcut like en is deprecated, because this usage is misleading: there are many different en or es models, so it should always be clear which package is being loaded. For example, en_core_web_sm or es_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: pip install spacy==2.3.5 I install... but not response my chatterbot in the web... suposly is work this.... the problem is I am novato no programer... I am musician... |
Look...
I uses in ssh this.. for english pip install spacy==2.3.5 for spanish pip install spacy==2.3.5 But not instaled 2.3.5 is 2.3.1...--circe . |
2.3.1 still gives the same error for me. |
See first what spacy do you have whit... python -m spacy validate If have 3.0 used pip install spacy==2.3.5 And... pip install spacy==2.3.5 |
can't install en_core_web_sm via pip |
Hey, dude try install spacy with >> pip install -U spacy Before that, go to C:\python37\Lib\site-packages\chatterbot and open the file tagging.py and change the code To
try that ant tell me if work. |
Install with:
Since class PosLemmaTagger loads spacy from self.language and StorageAdapter creates an instance of PosLemmaTagger with tagger_language:
You can load the chatbot by passing the language as a parameter to the Storage adapter, like this:
|
@andre0shazam gracias, tu solución funciono para mi. |
I ran into the same problem when I was trying the tutorial. I'm new to ChatterBot so I'm not sure exactly what is the best way to solve the problem. However, I wanted to approach working around this issue without messing around with the source code until a fix is in place. After reviewing the code, it was as simple as setting up a custom language class with the new model naming convention so here is my take at a workaround:
|
It would be great for somebody to slap together a pull request for this |
I have fixed the issue on pull request, please take a look on it and if everything seems okay, proceed with supporting this code to be included in next releases, and of course leave any suggestion or comment there so I can improve or fix anything you find |
It's been over a year, the issue still persists in the latest version, and the PR is waiting for checks. What's up with the pipeline? 🤔 |
I have lost track of the documentation on how to setup and run the checks, if someone can point me to them I will gladly run those checks to submit the merge request. |
Please fork this project if there is no progress here. There is so much free tech out there to make smart chatbots; people will need a place to integrate it. |
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
File "test.py", line 4, in
chatbot = ChatBot('Ron Obvious')
File "/home/pi/.local/lib/python3.7/site-packages/chatterbot/chatterbot.py", line 28, in init
self.storage = utils.initialize_class(storage_adapter, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/chatterbot/utils.py", line 33, in initialize_class
return Class(*args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/chatterbot/storage/sql_storage.py", line 20, in init
'tagger_language', languages.ENG
File "/home/pi/.local/lib/python3.7/site-packages/chatterbot/tagging.py", line 13, in init
self.nlp = spacy.load(self.language.ISO_639_1.lower())
File "/home/pi/.local/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/pi/.local/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")
The text was updated successfully, but these errors were encountered: