gunthercox / chatterbot-corpus

A multilingual dialog corpus
http://chatterbot-corpus.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.37k stars 1.14k forks source link

Conditional response to questions #72

Closed ShaguftaMethwani closed 6 years ago

ShaguftaMethwani commented 6 years ago

In chatterbot is it possible to have a response based on a condition? For example if the user replies yes to ". Does that help?", repl with "great!", if the user replies No, suggest another solution and ask the same "does that help" question again.

vkosuri commented 6 years ago

@ShaguftaMethwani Multiple solutions to your problem

  1. You write your own logic adapter http://chatterbot.readthedocs.io/en/stable/logic/create-a-logic-adapter.html
  2. Writing a preprocessors http://chatterbot.readthedocs.io/en/stable/preprocessors.html
ShaguftaMethwani commented 6 years ago

This is to process answers on a generic manner. But I have to suggest a different reply to every question. As mentioned in https://github.com/gunthercox/ChatterBot/issues/1262 , I want to have a continuous conversation. If yes is replied to Q1 reply will be A1 and if no is replied then reply will be A2. Also, for Q2 if yes is replied, reply from bot will be A3, if no is replied, reply from bot will be A4.Is that possible?

vkosuri commented 6 years ago

Yes, Go trhough this example https://github.com/gunthercox/ChatterBot/blob/master/examples/learning_feedback_example.py may be you will get some idea how to implement your solution.