First I was getting an error 'UnicodeDecodeError: 'charmap' codec can't decode byte 0x81' and it seemed like data was getting trained for first three files and error crept on fourth file when I checked the folder a new file was created at fourth spot 'dsqlite3' and some other pickle file.I have a doubt that because of the creation of these files in the folder code is giving an error of 'unicodedecodeerror'. But now the code is giving a different error"FileNotFoundError: [Errno 2] No such file or directory: 'ai.yml'" Please share your insights. '
I think maybe I am making a mistake in the code.
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
import os
bot= ChatBot("Bot")
trainer = ListTrainer(bot)
for files in os.listdir(r"C:/Users/sachin/Desktop/Pythonfiles/Chatbot/chatterbot-corpus-master/chatterbot_corpus/data/english"):
data=open(files,"r").readlines()
trainer.train(data)
while True:
message=input('You :')
if message.strip()!= 'Bye':
reply=bot.get_response(message)
print('Chatbot',reply)
if message.strip()=='Bye':
print('ChatBot: Bye')
break