New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'ChatBot' object has no attribute 'set_trainer' #1555
Comments
Hi @Chingcham, make sure you are viewing the https://chatterbot.readthedocs.io/en/latest/quickstart.html#training-your-chatbot from chatterbot.trainers import ListTrainer
conversation = [
"Hello",
"Hi there!",
"How are you doing?",
"I'm doing great.",
"That is good to hear",
"Thank you.",
"You're welcome."
]
trainer = ListTrainer(chatbot)
trainer.train(conversation) |
Thank you! I suspected that, but I was unable to find version difference for documentation. The link helped. |
This is my code from chatterbot import ChatBot bot=ChatBot('Bot') for files in os.listdir('C:\chatterbot-corpus-1.2.0\chatterbot_corpus\data\english/'): @gunthercox can you please help me with the error(AttributeError: 'ChatBot' object has no attribute 'set_trainer') |
@moiz7994 Please see the example in my code above (#1555 (comment)) You need to modify your code to match the new format. |
I am running the below code: from chatterbot import ChatBot #import the chatbot bot= ChatBot('Bot') for files in os.listdir ('C:/Users/XXX/Desktop/chatterbot-corpus-master/chatterbot_corpus/data/english/'): while True: I am getting the below error while running the code Test1.py: |
from chatterbot import ChatBot bot = ChatBot('Bot') trainer = ChatterBotCorpusTrainer(ChatBot) for files in os.listdir('C:/Users/Dell/Downloads/chatterbot-corpus-master/chatterbot_corpus/data/english/'): while True:
this error is showing... [nltk_data] Downloading package averaged_perceptron_tagger to |
@kbose02, @dilzeet100 I believe I have been able to answer your questions here: #1586 and here: gunthercox/chatterbot-corpus#112. |
from chatterbot import ChatBot #import the chatbot bot= ChatBot('Bot') corpus_path='C:/Users/716926/Downloads/chatterbot-corpus-master/chatterbot-corpus-master/chatterbot_corpus/data/english/' for file in os.listdir(corpus_path): while True: (base) C:\Users\716926\Documents\hello>D:/Development_Avecto/Anaconda3/python.exe c:/Users/716926/Documents/hello/bot.py I am getting an extra line That "No value for search_text was available on the provided input" can you help me with that |
Sure, that output (
You can add these lines to the top of your program. |
This is my code: conversation = [ trainer = ListTrainer(chatbot) This is the error: Python version: 3.7.2 Why does ListTrainer not work? I have tried many different solutions but nothing works. Sometimes ListTrainer downloads only 14% and then it quits with an error. |
Thank you, solved. |
HI, I am facing an issue regarding set_trainer in chatterbot please check the bellow code if their is any error please let me know from flask import Flask, render_template app = Flask(name) english_bot = ChatBot("Chatterbot", storage_adapter="chatterbot.storage.SQLStorageAdapter") english_bot.set_trainer(ListTrainer) @app.route("/") @app.route("/get") if name == "main": from flask import Flask, render_template, requestfrom chatterbot import ChatBotfrom chatterbot.trainers import ChatterBotCorpusTrainerapp = Flask(name)english_bot = ChatBot("Chatterbot", storage_adapter="chatterbot.storage.SQLStorageAdapter")english_bot.set_trainer(ChatterBotCorpusTrainer)english_bot.train("./data")@app.route("/")def home():return render_template("index.html")@app.route("/get")def get_bot_response():userText = request.args.get('msg')return str(english_bot.get_response(userText))if name == "main":app.run()Thank you in Advance |
@mady143 Please see this comment for an example of how to change your training code: |
from chatterbot import ChatBot bot = ChatBot('Bot') trainer = ListTrainer(bot) for files in os.listdir('C:/Users/Era/Desktop/Chat/chatterbot-corpus-master/chatterbot-corpus-master/chatterbot_corpus/data/english/'): while True: |
hi bro i am also same issue facing but fix this error please following solve error steps: install same version packages issue is solved ..... |
hi ! i am also same issue facing but fix this error please following solve error steps: install same version packages issue is solved ..... |
hi bro i am also same issue facing but fix this error please following solve error steps: install same version packages issue is solved ..... |
hi bro i am also same issue facing but fix this error please following solve error steps: install same version packages issue is solved ..... |
Hi,
Just after installing ChatterBot ( version is 1.0.0a3.) , I tried to execute the following code snippet from quick start guide:
It failed to execute with the error, " AttributeError: 'ChatBot' object has no attribute 'set_trainer' ". I couldn't find any other post related to this attribute either.
I skimmed through the code of chatterbot.py and found ChatBot indeed has neither 'set_trainer' nor 'train' function.
Am I missing something here? I would really appreciate if anybody could help me here.
Thanks,
The text was updated successfully, but these errors were encountered: