Open SMRN opened 4 years ago
@SMRN I was having the same problem with the responses. best solution to this would be write your own database of chats and use chatterbot.logic.BestMatch and keep the maximum_similarity_threshold to 0.90.
@SMRN for reference, you can check out:
Hi, my chatbot learned by simple yml file, but unfortunately the chosen answer is the one with the lowest confidence. -------------------------------Answers----------------- I need a job Robot : We don't have any car I need a TV Robot : We don't have any car -------------------------------------------yml file----------------------
We don't have any job --------------------------------------my source code---------------------------- from chatterbot import ChatBot import nltk from chatterbot.trainers import ChatterBotCorpusTrainer Mybot=ChatBot("David", logic_adapters=[ { 'import_path': 'chatterbot.logic.BestMatch', 'statement_comparison_function': 'chatterbot.comparisons.SynsetDistance', 'maximum_similarity_threshold': 0.1, } ] ) trainer=ChatterBotCorpusTrainer(Mybot) trainer.train("chatterbot.corpus.mysource") while True: try: user_input=input() bot_response=Mybot.get_response(user_input) print('Robot :',bot_response) except(KeyboardInterrupt, EOFError, SystemExit): break
Can anyone help me? thanks for your time.