【问题标题】:Closing a bot in AIML在 AIML 中关闭机器人
【发布时间】:2020-03-17 01:37:40
【问题描述】:

我一直在编写一个可以预约牙科诊所的机器人作为示例。如果人类试图在没有时间的情况下预约,机器人会询问他/她是否想要另一天。如果人类说“不”之类的话,我想关闭机器人,这样看起来人类或机器人已经挂断了。 提前谢谢你,如果我没有正确解释我,请问你需要什么。

【问题讨论】:

  • 你不能创建一个类别,让机器人说:“好的,谢谢你过来。再见”?
  • 是的,首先我是这么想的。但是我想知道是否有类似的东西可以迫使人类再次开始对话(在我看来这是最自然的反应)所以我认为这可能是关闭机器人/窗口

标签: aiml


【解决方案1】:
//textLine is the human answer
    if ((textLine == null) || (textLine.length() < 1))
        textLine = MagicStrings.null_input;
    if (textLine.equals("no")) {
        System.exit(0);
    } else {
        String request = textLine;
        if (MagicBooleans.trace_mode)
            System.out.println("STATE=" + request + ":THAT=" + ((History) chatSession.thatHistory.get(0)).get(0) + ":TOPIC=" + chatSession.predicates.get("topic"));
        String response = chatSession.multisentenceRespond(request);
        while (response.contains("&lt;"))
            response = response.replace("&lt;", "<");
        while (response.contains("&gt;"))
            response = response.replace("&gt;", ">");
    }

System.out.println(响应); //response是bot响应

这是我的java代码 如果我发送“否”,则机器人退出

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-01-12
    • 1970-01-01
    • 2011-02-01
    • 2020-03-22
    • 2015-10-03
    • 2021-10-24
    • 2011-11-24
    • 2022-01-02
    相关资源
    最近更新 更多