Created a chatbot using python and the flow in which it is working is that I am messeging and according to that Chatbot is replying. But it should be done in reverse means chat bot should start first by welcoming/asking questions, then user will reply to that. Please suggest some transformation to be made in the code so that it can work accordingly. Thanking you in advance.
The code for the above mentioned goes like this:
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
import os
bot = ChatBot('Bot')
bot.set_trainer(ListTrainer)
for files in os.listdir('C:/Users/Username\Desktop\chatterbot\chatterbot_corpus\data/english/'):
data = open('C:/Users/Username\Desktop\chatterbot\chatterbot_corpus\data/english/' + files, 'r').readlines()
bot.train(data)
while True:
message = input('You: ')
if message.strip() != 'Bye'.lower():
reply = bot.get_response(message)
print('ChatBot:',reply)
if message.strip() == 'Bye'.lower():
print('ChatBot: Bye')
break