dineshsambasivam / Chatbot_Project

ChatBot with interactive UI using simple web socket server
39 stars 38 forks source link

how can i use effiziently logic adapter in my code ? #5

Open FranckDemanou opened 4 years ago

FranckDemanou commented 4 years ago

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 ?