for files in os.listdir('C:/Users/franc\Documents\Bachelorarbeit\data\SmartHome/'):
data = open('C:/Users/franc\Documents\Bachelorarbeit\data\SmartHome/' + files, 'r').readlines()
trainer.train(data)
while True:
message = input('You: ')
if message.strip()!= 'Bye':
reply = chatbot.get_response(message)
print('Chatbot: ', reply)
if message.strip() == 'Bye':
print('ChatBot: Bye')
break
How can i use logic adapter to make the bot clever ?
I have writted this code based on your own:
from chatterbot.trainers import ListTrainer # method to train the chatbot from chatterbot import ChatBot # import the chatbot import os
chatbot = ChatBot('Bot') trainer = ListTrainer(chatbot)
for files in os.listdir('C:/Users/franc\Documents\Bachelorarbeit\data\SmartHome/'):
data = open('C:/Users/franc\Documents\Bachelorarbeit\data\SmartHome/' + files, 'r').readlines() trainer.train(data)
while True: message = input('You: ') if message.strip()!= 'Bye': reply = chatbot.get_response(message) print('Chatbot: ', reply) if message.strip() == 'Bye': print('ChatBot: Bye') break
How can i use logic adapter to make the bot clever ?