I made a simple chatbot using chatterbot library and python. The way I trained it is, I made it read a few text files containing chat examples, and it learns how to reply to messages based on those training examples. The problem I am facing is - Even if I erase the contents of the training text files, and run the application, the chatbot still behaves in the same manner as before, i.e. it's memory doesn't get refreshed. I tried starting a new file and copy pasted the same code and changed the name of the program, but it still doesn't help. How do I solve this problem? Here is the code for reference:
from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
import os
bot = ChatBot('trialBot')
bot.set_trainer(ListTrainer)
#directory containing training text files
mainDir = 'C:\\Users\\xyz\\Desktop\\trainfiles\\'
for _file in os .listdir(mainDir):
chats = open(mainDir + _file, 'r').readlines()
bot.train(chats)
while True:
request = raw_input('You: ')
response = bot.get_response(request)
print('Bot: ' + str(response))