I was searching the internet on "How to build a Chatbot?" and I discovered ChatterBot which is a machine learning, conversational dialog engine for...
For further actions, you may consider blocking this person and/or reporting abuse
do pip install chatterbot-corpus
Then
Make the following changes to your code
remove the following lines
bot.set_trainer(ListTrainer)
bot.set_trainer(ChatterBotCorpusTrainer)
bot.train("chatterbot.corpus.english")
Add the following
trainer = ChatterBotCorpusTrainer(bot)
trainer.train('chatterbot.corpus.english')
Remove the following
training on english dataset
for files in os.listdir('./english/'):
data=open('./english/'+files,'r').readlines()
data=open('./english/'+files,'r').readlines()
trainer.train(data)
It should work now.
im not able to execute this code, cud u help me out with that..? can dm me abt it..?
What error you are facing?
cant import error
Download all the libraries.
I faced an issue when training using corpus files through "ListTrainer". seems even "categories" and "conversations" tags in yml file also get inserted into the data source.
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
from chatterbot.trainers import ListTrainer
bot = ChatBot("Candice")
bot.set_trainer(ListTrainer)
bot.set_trainer(ChatterBotCorpusTrainer)
bot.train("chatterbot.corpus.english")
Try this
Try chatgen.ai to create chatbots. You can create click based as well as NLP Bots.
Hello
While running your code I am getting this error
AttributeError: 'ChatBot' object has no attribute 'set_trainer'
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
from chatterbot.trainers import ListTrainer
bot = ChatBot("Candice")
bot.set_trainer(ListTrainer)
bot.set_trainer(ChatterBotCorpusTrainer)
bot.train("chatterbot.corpus.english")
Try this and if you still get the same error. You can contact me via mail: sahil.rajput.0196@gmail.com
any open source code and tools to design a website-based chatbot for the business need of a company?