基本 AIML 响应?

发布于 2024-09-04 20:03:17 字数 885 浏览 5 评论 0原文

您认为编程的重要模式/寺庙是什么?就像在聊天机器人中一样,每个聊天机器人都需要响应做什么?我刚刚开始制作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>

What do you think are important pattern/temples to program. Like in a chatbot what does EVERY chatbot need a response for? Im just starting out making the aiml file and need some help...

Heres the file now.

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

萝莉病 2024-09-11 20:03:18

www.alicebot.org 正在提供 Superbot 其中包含前 10,000 个模式的 aaml 文件。然而,对于爱好者来说可能太贵了。

根据我自己的经验,您肯定需要对以下方面的模式进行答复:

  • 问候语(嗨/你好)
  • 姓名(您是谁?)
  • 年龄(您多大了?)
  • 生日(您何时出生?)
  • 性别/物种(您是什么?你?)
  • 幸福(你好吗?)

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

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

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

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

www.alicebot.org are offering a Superbot which contains an aiml file of the top 10,000 patterns. However, it is probably too expensive for the hobbyist.

In my own experience, you will definitely need responses for patterns relating to:

  • Greetings (Hi/Hello)
  • Name (Who are you?)
  • Age (How old are you?)
  • Birthday (When were you born?)
  • Gender/species (What are you?)
  • Well being (How are you?)

If you are starting from scratch, the problems arise when you try to think of all the different ways a user might ask a question, for example the bot's name

  • What is your name?
  • What are you called?
  • What do they call you?
  • And you are?
  • My name is Jim, what's yours?
  • etc, etc

Can I also point out that the wildcards in patterns should be separated from other words so that parsers can pick them up as distinct words in the input strings.

<pattern>WHEN WERE YOUR BORN *</pattern>
黑凤梨 2024-09-11 20:03:17

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

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

You may want to include basic/common patterns of speech that can be simplified or redirected to another category. Here are some examples that handle definition retrieval.

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

More useful AIML lines of code that pertain more to your question would be these:

<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>
遥远的她 2024-09-11 20:03:17

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

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

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

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

另外,在你的第一行:

<pattern>Hey</pattern>. 

这是不正确的。请记住,图案始终为大写字母!所以这样做:

<pattern>HEY</pattern>

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

Well, I would sugest visiting these two websites:

http://aitools.org/Free_AIML_sets (dead link)

AND

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

They have many .aiml files with TONS of categories that will definitely add knowledge to your bot.

ALSO, on your first line:

<pattern>Hey</pattern>. 

This is not correct. Remember, the pattern is always in CAPS! So do this:

<pattern>HEY</pattern>

This are also there are NO punctuations in AIML patterns.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文