Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from chatterbot import ChatBot
- from chatterbot.trainers import ChatterBotCorpusTrainer
- import os
- bot= ChatBot('Bot')
- trainer = ChatterBotCorpusTrainer(bot)
- corpus_path='/home/rat/Desktop/chatterbot-corpus-master/chatterbot_corpus/data/english/'
- for file in os.listdir(corpus_path):
- trainer.train(corpus_path + file)
- while True:
- message = input('You: ')
- if message.strip() == 'Bye':
- print('ChatBot: Bye')
- break
- else:
- reply = bot.get_response(message)
- print('ChatBot:', reply)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement