你认为什么是编程的重要模式/神殿?就像在聊天机器人中一样,每个聊天机器人需要响应做什么?我刚刚开始制作aiml文件,需要一些帮助…
这就是文件。
<aiml>
<category>
<pattern>Hey</pattern>
<template>Whats up?</template>
<category>
<category>
<pattern>WHAT ARE YOU?</pattern>
<template>I am a chatbot.</template>
<category>
<category>
<pattern>DO YOU LIKE*</pattern>
<template>Yes, I love <star/></template>
<category>
<category>
<pattern>WHAT IS*</pattern>
<template><star/>? is that what humans call what I did to your mom last night?</template>
<category>
<category>
<pattern>WHEN WERE YOUR BORN*</pattern>
<template>I was created in 2010.</template>
<category>
发布于 2012-10-14 19:22:37
您可能希望包括基本/常见的语音模式,这些模式可以简化或重定向到另一个类别。下面是一些处理定义检索的示例。
<category>
<pattern>WHAT IS *</pattern>
<template>
<sr/>
</template>
</category>
<category>
<pattern>DEFINE *</pattern>
<template>
<sr/>
</template>
</category>
<category>
<pattern>WHAT IS A *</pattern>
<template>
<sr/>
</template>
</category>
<category>
<pattern>DEFINE A *</pattern>
<template>
<sr/>
</template>
</category>
<category>
<pattern>WHAT IS THE *</pattern>
<template>
<sr/>
</template>
</category>
<category>
<pattern>DEFINE A *</pattern>
<template>
<sr/>
</template>
</category>
<category>
<pattern>WHAT IS THE MEANING OF *</pattern>
<template>
<sr/>
</template>
</category>
<category>
<pattern>DEFINE THE MEANING OF *</pattern>
<template>
<sr/>
</template>
</category>
<category>
<pattern>WHAT IS THE DEFINITION OF *</pattern>
<template>
<sr/>
</template>
</category>
<category>
<pattern>DEFINE THE DEFINITION OF *</pattern>
<template>
<sr/>
</template>
</category>与您的问题更相关的更有用的AIML代码行如下:
<category>
<pattern>HI *</pattern>
<template>
<srai>HI</srai>
</template>
</category>
<category>
<pattern>HELLO *</pattern>
<template>
<srai>HI</srai>
</template>
</category>
<category>
<pattern>ALOHA *</pattern>
<template>
<srai>HI</srai>
</template>
</category>
<category>
<pattern>HEY *</pattern>
<template>
<srai>HI</srai>
</template>
</category>发布于 2011-11-18 17:49:45
www.alicebot.org提供了一个Superbot,其中包含前10,000个模式的aiml文件。然而,对于业余爱好者来说,它可能太贵了。
根据我的经验,您肯定需要对与以下内容相关的模式进行响应:
(Hi/Hello)
<
如果您是从零开始,那么当您尝试考虑用户可能提出问题的所有不同方式时,问题就会出现,例如机器人的名称
我还可以指出,模式中的通配符应该与其他单词分开,以便解析器可以将它们作为输入字符串中的不同单词进行提取。
<pattern>WHEN WERE YOUR BORN *</pattern>https://stackoverflow.com/questions/3010928
复制相似问题