【问题标题】:AIML multiple patterns with one response一种响应的 AIML 多种模式
【发布时间】:2021-03-11 01:06:32
【问题描述】:

假设我希望用户对机器人的多个问候有一个单一的响应。有没有更好的方法来使用“或”语句或列表来编写这个,而不是用所有这样的模板写出每个案例来重定向模式?

<category>
    <pattern> HELLO</pattern>
    <template>
        Hello User!
    </template>
</category>

 <category>
    <pattern> HI</pattern>
    <template>
        <srai> HELLO</srai>
    </template>
</category>

     <category>
    <pattern> HOWDY</pattern>
    <template>
        <srai> HELLO</srai>
    </template>
</category>

【问题讨论】:

    标签: chatbot aiml


    【解决方案1】:

    您可以创建一个名为“greetings”的集合,其中包含不同的打招呼方式,如下所示:

    然后写这个类:

    <category>
        <pattern>^ <set>greetings</set> ^</pattern>
        <template>Hello User!</template>
    </category> 
    

    但对我来说,为每个选项创建新类别并 到您的主要类别要容易得多,就像在您的原始示例中一样。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多