AIML Chatbot的响应时间不同吗? [英] AIML Chatbot response differs at different times?
问题描述
在我之前的文章中对AIML机器人有一个单独的问题...您如何创建在一天的不同时间响应的机器人?我觉得这会让他看起来更真实。
A separate question for the AIML bot in my previous post... How do you create a bot that responds at different times of the day? I feel like it will make him seem more "real."
我无法在日期和时间显示的实际方式上大跌眼镜。我认为您必须在set / get函数旁边摆弄它……但这就是我所知道的全部。
I can't make heads or tails about how the date and time display actually works. I assume you'd have to fiddle with that alongside the set/get functions... but that's all I know for sure.
我希望我的机器人执行类似的操作。
I would like my bot to do something like this.
时间:中午
TIME: Noon
用户:机器人。
BOT:下午好,用户!对我来说是午餐时间。
BOT: Good afternoon, USER! It's about lunchtime for me.
我从哪里开始?谢谢。
推荐答案
您需要检查小时,然后使用条件给出适当的响应。在此类别中,即使有人在深夜说早上好,机器人也会做出明智的反应
You need to check the hour and then use condition to give an appropriate response. Here's a category where the bot will respond sensibly even if someone says "Good morning" in the middle of the night
<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>
这篇关于AIML Chatbot的响应时间不同吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!