【问题标题】:AIML Chatbot response differs at different times?AIML 聊天机器人的响应在不同时间有所不同?
【发布时间】:2019-09-07 02:10:55
【问题描述】:
在我之前的帖子中针对 AIML 机器人提出了一个单独的问题...如何创建一个在一天中的不同时间做出响应的机器人?我觉得这会让他看起来更“真实”。
我无法确定日期和时间显示的实际工作原理。我假设您必须在设置/获取功能旁边摆弄它……但我肯定知道这些。
我希望我的机器人做这样的事情。
时间:中午
用户:嗨,机器人。
BOT:下午好,用户!我的午餐时间差不多了。
我从哪里开始?谢谢。
【问题讨论】:
标签:
date
time
chatbot
clock
aiml
【解决方案1】:
您需要检查小时,然后使用条件给出适当的响应。这是一个类别,即使有人在半夜说“早上好”,机器人也会做出明智的反应
<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>