AIML Chatbot响应在不同时间有所不同?

问题描述 投票:0回答:1

在我之前的文章中对AIML机器人有一个单独的问题...您如何创建在一天的不同时间响应的机器人?我觉得这会让他看起来更“真实”。

关于日期和时间显示的实际工作方式,我无能为力。我认为您必须在set / get函数旁边摆弄它……但这就是我所知道的全部。

我希望我的机器人做这样的事情。

时间:中午

USER:嗨,机器人。>>

BOT:下午好,USER!对我来说是午饭时间。

我从哪里开始?谢谢。

在我之前的文章中对AIML机器人有一个单独的问题...您如何创建在一天的不同时间响应的机器人?我觉得这会让他看起来更“真实”。我无法扬程或...

date time chatbot clock aiml
1个回答
0
投票

您需要检查小时,然后使用条件给出适当的响应。这是一个类别,即使有人在深夜说“早上好”,机器人也会做出明智的反应。

<category>
<pattern>GOOD MORNING</pattern>
<template>
    <think><set name="hour"><date format="%H"/></set></think>
    <condition name="hour">
        <li value="00">Hello, it's more like the middle of the night than morning. How are you this morning?</li>
        <li value="01">Hello, it's only just morning. How are you this morning?</li>
        <li value="02">Hello and how are you this morning?</li>
        <li value="03">Hello and how are you this morning?</li>
        <li value="04">Hello and how are you this morning?</li>
        <li value="05">Hello and how are you this morning?</li>
        <li value="06">Hello and how are you this morning?</li>
        <li value="07">Hello and how are you this morning?</li>
        <li value="08">Hello and how are you this morning?</li>
        <li value="09">Hello and how are you this morning?</li>
        <li value="10">Hello and how are you this morning?</li>
        <li value="11">Hello and how are you this morning?</li>
        <li value="12">You're a bit late. It's lunchtime here.</li>
        <li value="13">Morning?! It's the afternoon here.</li>
        <li value="14">Morning?! It's the afternoon here.</li>
        <li value="15">Morning?! It's the afternoon here.</li>
        <li value="16">Morning?! It's the afternoon here.</li>
        <li value="17">Morning?! It's nearly evening.</li>
        <li value="18">Morning?! It's evening here.</li>
        <li value="19">Morning?! It's evening here.</li>
        <li value="20">Morning?! It's evening here.</li>
        <li value="21">Morning?! It's night time here.</li>
        <li value="22">Morning?! It's night time here.</li>
        <li value="23">Morning?! It's night time here.</li>
    </condition>
</template>
© www.soinside.com 2019 - 2024. All rights reserved.