#1867·ChatterBot

对简单问题的回答错误!!

作者: SMRN创建于 2019年11月12日更新于 2025年10月25日
标签possible bug

你好,我的聊天机器人通过简单的 yml 文件进行学习,但不幸的是,选择的答案是信任度最低的答案。-------------------------------答案----------------- 我需要一份工作 机器人:我们没有汽车 我需要一台电视 机器人:我们没有汽车 ------------------------------------------yml 文件----------------------------- - - 我需要一辆自行车 - 我们没有自行车 - - 我需要一辆汽车 - 我们没有汽车 - - 我需要一台电视 - 我们没有电视 - - 我需要一份工作 - 我们没有工作 ---------------------------------------我的源代码----------------------------- 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 -------------------------------------------------------------- 有人能帮我吗?谢谢您的时间。

内容来源: gunthercox/ChatterBot