1

I want to develop my own custom chatbot but I get some issue during the development, I want to use Specific Response Adapter in chatterbot. There is a sample of code.

from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
bot = ChatBot('Mybot',
storage_adapter='chatterbot.storage.SQLStorageAdapter',
logic_adapters=[{'import_path': 'chatterbot.logic.SpecificResponseAdapter',
               'input_text': 'Help me!',
                'output_text': 'Ok'
                        }]) # Crate Chatbot
trainer = ListTrainer(bot)
text = open('/content/drive/My Drive/Chatbot/Data/data.txt').readlines()
trainer.train(text)

while True:
   request = input("Your: ")
   response = bot.get_response(request)
   print("bot:",response)

This is the output:

 Your: Help me!
 bot: I am sorry, but I do not understand.
 Your: 'Help me!'
 bot: I am sorry, but I do not understand.

please help me to solve this problem

RMPR
  • 3,368
  • 4
  • 19
  • 31

0 Answers0