I have a piece of code I took from an example. It was running fine on repl.it, like a response after few secs. But, some time later, it started returning a response after like 1-3 mins, even more or never.
That started happening suddenly on a run restart. I tried resetting the database. That didn't help. Then I tried making a new repl. That didn't help either
Here is my code:
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
import logging
'''
This is an example showing how to train a chat bot using the
ChatterBot Corpus of conversation dialog.
'''
# Enable info level logging
logging.basicConfig(level=logging.INFO)
chatbot = ChatBot('Example Bot')
# Start by training our bot with the ChatterBot corpus data
chatbot.set_trainer(ChatterBotCorpusTrainer)
chatbot.train(
'chatterbot.corpus.english'
)
while True:
inp = input("=> ")
print(chatbot.get_response(inp))
It starts working fine but gets stuck at:
/opt/virtualenvs/python3/lib/python3.8/site-packages/chatterbot/storage/jsonfile.py:24: UnsuitableForProductionWarning:The JsonFileStorageAdapter is not recommended for production environments.
warnings.warn(
=> Hello
INFO:chatterbot.adapters:Recieved input statement: Hello
INFO:chatterbot.adapters:"Hello" is a known statement
Here is the repl link: https://repl.it/@blackskull12/chatterbottest#main.py
If I replace:
chatbot.set_trainer(ChatterBotCorpusTrainer)
chatbot.train(
'chatterbot.corpus.english'
)
to:
trainer = ChatterBotCorpusTrainer(chatbot)
trainer.train(
'chatterbot.corpus.english'
)
This change works fine on my pc. But gives error on repl. ChatBot has no atribute 'find'
I have no idea where to continue. Can anybody help me and brink some life back to my bot?