【问题标题】:Essential AIML responses?基本的 AIML 响应?
【发布时间】:2010-06-10 00:36:01
【问题描述】:

您认为编程的重要模式/模板是什么。就像在聊天机器人中一样,每个聊天机器人都需要响应什么?我刚开始制作目标文件,需要一些帮助...

现在是文件。

<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>

【问题讨论】:

    标签: xml chatbot aiml


    【解决方案1】:

    您可能希望包含可以简化或重定向到另一个类别的基本/常见语音模式。以下是一些处理定义检索的示例。

    <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>
    

    【讨论】:

      【解决方案2】:

      好吧,我建议访问这两个网站:

      http://aitools.org/Free_AIML_sets(死链接)

      http://www.alicebot.org/aiml/aaa/

      他们有许多 .aiml 文件,其中包含大量类别,肯定会为您的机器人增加知识。

      另外,在你的第一行:

      <pattern>Hey</pattern>. 
      

      这是不正确的。请记住,模式总是大写!这样做:

      <pattern>HEY</pattern>
      

      这也是 AIML 模式中没有标点符号。

      【讨论】:

      • 全部大写的模式是一种约定,而不是要求。 “嘿”很好。
      • Aitools -> 死链接。
      【解决方案3】:

      www.alicebot.org 提供Superbot,其中包含前 10,000 个模式的 aiml 文件。但是,对于业余爱好者来说,它可能太贵了。

      根据我自己的经验,您肯定需要对以下相关模式的响应:

      • 问候(嗨/你好)
      • 姓名(你是谁?)
      • 年龄(你几岁?)
      • 生日(你什么时候出生?)
      • 性别/物种(你是什么?)
      • 健康(你好吗?)

      如果您从头开始,当您尝试考虑用户可能提出问题的所有不同方式时就会出现问题,例如机器人的名称

      • 你叫什么名字?
      • 你叫什么?
      • 他们怎么称呼你?
      • 你是?
      • 我叫吉姆,你叫什么?
      • 等等等等

      我还可以指出,模式中的通配符应该与其他单词分开,以便解析器可以将它们作为输入字符串中的不同单词提取出来。

      <pattern>WHEN WERE YOUR BORN *</pattern>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-08-27
        • 1970-01-01
        • 1970-01-01
        • 2019-09-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-03
        相关资源
        最近更新 更多