Hey I am trying to train my chatbot with existing corpuses using chatterbot but I found that my chatbot cannot be trained. It seems to get stuck when it comes to the line bot.train(data). Here is my code:
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
import os
bot = ChatBot('ChatBot')
bot.set_trainer(ListTrainer)
new = []
for files in os.listdir('/Users/christinalai/Desktop/corpus'):
data = open('/Users/christinalai/Desktop/corpus/' + files, mode='r',errors="ignore").readlines()
for line in data:
new.append(line)
bot.train(new)
while True:
message = input("You: ")
if message.strip() not in message_list:
reply = bot.get_response(message)
print("ChatBot: ", reply)
Thanks for looking at my question.