question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chatterbot with feedback

See original GitHub issue

Hi! I’m a beginner in ChatterBot and I’m very impressed with its features! Thank you in advance. But I’ve an interest in a feedback of user if the bot doesn’t be able to answer with the better solution. For example: if I ask “How are you?” and its database only has the answer “I’m fine”, and I want the answer “I’m not very well”, I will need to update the database with the new answer. In my code, I achieve it inserting two news sentences in my list “ans”. But asking new questions, the bot doesn’t deliver my wish answer, replacing the previous. And the examples at the GitHub “learning feedback” and “default response” seems doesn’t working very well (at least in my computer). Can you help me to impose to bot to choose the better answer based on my feedback? I would like to use the feedback to update directly the database, removing a statement of database, for in a new questioning, the bot already answer me with new entry. I don’t know how to remove a statement of database. In many tries, the answer didn’t change, altough the list updated… Thanks.

from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot

question,answer,y,n="","","",""

bot = ChatBot('Answ Bot')

ans= ['How are you?', 'I'm fine','And you?','I'm fine too, thanks']

bot.set_trainer(ListTrainer)
bot.train(ans)

while True:
    question= input("User: ")
    answer= bot.get_response(question)
    if float(question.confidence) > 0.5:
        print('Answ Bot: ', answer)
        print('Answ Bot: was my response good? [y/n]')
        r1=input()
        if r1=='y':
            print('Answ Bot: thank you for feedback')
        else:
            print('Answ Bot: may you teach me a better answer?')
            r2=ans.index(answer)
            ans2=ans.copy()
            del ans2[r2]            
            answer2 = input("User: ")
            ans2.insert(r2,answer2)            
            bot.train(ans2)            
            print(ans2)
    else:
         print('I don't know the answer.')

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vkosuricommented, Nov 4, 2018
0reactions
lock[bot]commented, Oct 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customer feedback chatbot template - Joonbot
Collect feedback in a personal way using our customer feedback chatbot template. Offer a better user experience and get more feedback.
Read more >
6 Ways to Gather Feedback With AI chatbots - Ometrics
An AI-powered feedback bot will help online business owners collect feedback with conversational surveys. An AI-powered chatbot will not repeat questions in the ......
Read more >
Get Feedback from your Users with Chatbot from Dashly
A chatbot can collect feedback for you. It gives you an opportunity to enhance new features and the customer experience in general.
Read more >
Feedback Collection chatbot - Hybrid.Chat
Gain valuable insights about your service/products through feedback bot. Use simple conversations to understand what your customers need.
Read more >
Feedback & Survey Chatbot Templates
A Feedback & Survey chatbot is a fully automated piece of software that has a conversation with your prospects to capture and qualify...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found