gunthercox / ChatterBot

ChatterBot is a machine learning, conversational dialog engine for creating chat bots
https://chatterbot.readthedocs.io
BSD 3-Clause "New" or "Revised" License
14.1k stars 4.45k forks source link

error in response #1685

Open anjarul opened 5 years ago

anjarul commented 5 years ago

i have two statements, 1: clubs do you have . 2: departments do you have for both statements it provide same reply. here is my code

from chatterbot import ChatBot from chatterbot.trainers import ListTrainer from chatterbot.conversation import Statement

bot = ChatBot('Devil', logic_adapters=[{'import_path': 'chatterbot.logic.BestMatch', 'default_response': ' please contact with sub one stop', 'statement_comparison_function': 'JaccardSimilarity' }], read_only=True,

          )

ListTrainer(bot).train([ "how many clubs do you have","seven clubs", "clubs do you have","seven clubs", "how many departments do you have", "eight departments", "departments do you have","eight departments" ])

while True: message = input ('You: ') msg_statement = Statement(message) reply = bot.get_response(message)

print('Devil : ',reply)

if message.strip()=='bye':
    break;
ignertic commented 5 years ago

Try tweaking around like changing statement_comparison_function and read the docs to really understand how these work