首页 文章

如何在Chatterbot中编写多个低置信度响应?

提问于
浏览
1

我希望我的错误处理具有幽默和个性 . 根据文档,我可以插入一个低信任的默认响应 . http://chatterbot.readthedocs.io/en/stable/_modules/chatterbot/logic/low_confidence.html但我希望机器人能够提供各种低可信度的响应 . 问:我如何编写这些代码?

1 回答

  • -1

    至于我可以解决这个问题你可以使用给定的代码我认为你可以使用if elseif修改它

    导入日志记录

    def get_random_response(input_statement,response_list):

    from random import choice
     logger = logging.getLogger(__name__)
     logger.info(u'Selecting a response from list of {} options.'.format(
          len(response_list)
      ))
     return choice(response_list)
    

    get_random_response('你好吗',[我很好“,”做得好“,”想念你“,”想着你“])

相关问题