Design patterns &引用;那";标签不工作AIML

Design patterns &引用;那";标签不工作AIML,design-patterns,bots,categories,aiml,Design Patterns,Bots,Categories,Aiml,我正在尝试用AIML创建一个机器人,在下面的代码中,只有最后一项被识别为是。为什么会这样 <category> <pattern> * </pattern> <template><random> <li>Hi i am aviator wanna talk about boeing airplanes</li> <li>Hello how are you what about disc

我正在尝试用AIML创建一个机器人,在下面的代码中,只有最后一项被识别为是。为什么会这样

<category>
<pattern> * </pattern>
<template><random>
    <li>Hi i am aviator wanna talk about boeing airplanes</li>
    <li>Hello how are you what about discuss boeing airplanes</li>
    <li>Well hello wanna talk about boeing airplanes</li>
    <li>Hi there what abou talk of some boeing airplanes</li>
    <li>Hey there could we talk about boeing airplanes</li>
    <li>What about talk of airplanes</li>
</random></template>

* 
  • 嗨,我是飞行员,想谈谈波音飞机吗
  • 你好,你好,我们讨论一下波音飞机怎么样
  • 你好,想谈谈波音飞机吗
  • 嗨,那我们谈谈波音飞机怎么样
  • 嘿,我们能谈谈波音飞机吗
  • 那飞机呢
  • 
    对
    嗨,我是飞行员,想谈谈波音飞机吗
    你好,你好,我们讨论一下波音飞机怎么样
    你好,想谈谈波音飞机吗
    你好,想谈谈波音飞机吗
    嘿,我们能谈谈波音飞机吗
    那飞机呢
    好吧,那就是747了!
    


    提前感谢。

    这是因为模式中只能有一个“that”,而不是列表

    但是,您可以做的是设置一个“主题”,然后它将按照您的预期工作。作为回应,请在任务完成时重置主题

    <category>
    <pattern> * </pattern>
    <template>
    <think><set name = "topic">planes</set></think>
    <random>
        <li>Hi i am aviator wanna talk about boeing airplanes</li>
        <li>Hello how are you what about discuss boeing airplanes</li>
        <li>Well hello wanna talk about boeing airplanes</li>
        <li>Hi there what abou talk of some boeing airplanes</li>
        <li>Hey there could we talk about boeing airplanes</li>
        <li>What about talk of airplanes</li>
    </random></template>
    </category>
    
    
    <topic name="planes">
    
    <category>
    <pattern>YES</pattern>
     <template><think><set name = "topic"></set></think>OK then, <set name = "topic">747</set> it will be!</template>
    </category>
    </topic>
    
    
    * 
    飞机
    
  • 嗨,我是飞行员,想谈谈波音飞机吗
  • 你好,你好,我们讨论一下波音飞机怎么样
  • 你好,想谈谈波音飞机吗
  • 嗨,那我们谈谈波音飞机怎么样
  • 嘿,我们能谈谈波音飞机吗
  • 那飞机呢
  • 对 好吧,那就是747了!
    另一种方法是在
    模式中使用通配符。然后,您的第二个类别将成为:

    <category>
    <pattern>YES</pattern>
    <that>* AIRPLANES</that>
    <template>OK then, <set name = "topic">747</set> it will be!</template>
    </category>
    
    
    对
    *飞机
    好吧,那就是747了!
    
    开头的*与AI最后一次响应为任何以飞机结尾的文本时的YES输入相匹配。还要注意可选的AIML约定,即使用大写字母指定
    文本和
    文本

    <category>
    <pattern>YES</pattern>
    <that>* AIRPLANES</that>
    <template>OK then, <set name = "topic">747</set> it will be!</template>
    </category>