quick start error
first run error: no module named ‘spacy’. so I install spacy with cmd:
pip install spacy
python -m spacy download en_core_web_sm
then I run again but get another error:
File "/data/code/test/chatterbot_test/quick_start.py", line 4, in
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") python-BaseException
Process finished with exit code 1
the source code looks like the class chatterbot.languages.ENG no support attr ISO_639_1 = 'en', use ISO_639_1 = 'en_core_web_sm' instead? or another ways?
the errors.py define:
OLD_MODEL_SHORTCUTS = { "en": "en_core_web_sm", "de": "de_core_news_sm", "es": "es_core_news_sm", "pt": "pt_core_news_sm", "fr": "fr_core_news_sm", "it": "it_core_news_sm", "nl": "nl_core_news_sm", "el": "el_core_news_sm", "nb": "nb_core_news_sm", "lt": "lt_core_news_sm", "xx": "xx_ent_wiki_sm" } so i guess use 'en_core_web_sm' instead 'en'
Go to /home/bingo/anaconda3/envs/pytorch/lib/python3.7/site-packages/chatterbot/tagging.py and look for the line
self.nlp = spacy.load(self.language.ISO_639_1.lower())
and replace it with:
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())