各位朋友,想要用chatterbot训练机器人,下载的chatterbot版本为0.8.5,同时安装了spacy和en_core_web_sm,但是依然报错。
以下为我的测试代码:
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
bot = ChatBot("Candice")
trainer = ChatterBotCorpusTrainer(bot)
trainer.train("chatterbot.corpus.english")
以下为报错内容:
C:\Users\Melody\AppData\Local\Programs\Python\Python37\python.exe C:/Users/Melody/PycharmProjects/pythonProject1/main.py
ai.yml Training: [ ] 1%Traceback (most recent call last):
File "C:/Users/Melody/PycharmProjects/pythonProject1/main.py", line 5, in <module>
trainer.train("chatterbot.corpus.english")
File "C:\Users\Melody\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\trainers.py", line 133, in train
statement = self.get_or_create(text)
File "C:\Users\Melody\AppData\Local\Programs\Python\Python37\lib\site-packages\chatterbot\trainers.py", line 28, in get_or_create
statement = self.storage.find(statement_text)
AttributeError: 'ChatBot' object has no attribute 'find'
Process finished with exit code 1
请问如何能解决该问题?