"That" 标签不工作 AIML
"That" tag not working 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 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>
<pattern>YES</pattern>
<that>Hi i am aviator wanna talk about boeing airplanes</that>
<that>Hello how are you what about discuss boeing airplanes</that>
<that>Well hello wanna talk about boeing airplanes</that>
<that>Well hello wanna talk about boeing airplanes</that>
<that>Hey there could we talk about boeing airplanes</that>
<that>What about talk of airplanes</that>
<template>OK then, <set name = "topic">747</set> it will be!</template>
提前致谢。
这是因为在模式中只能有一个'that',而在列表中不能。
但是,您可以做的是设置一个 'topic',然后它就会如您所愿地工作。作为回应,请在任务完成后重新设置主题。
<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>
另一种方法是在 <that>
模式中使用通配符。您的第二个类别将变为:
<category>
<pattern>YES</pattern>
<that>* AIRPLANES</that>
<template>OK then, <set name = "topic">747</set> it will be!</template>
</category>
当 AI 的最后一个响应是任何以 AIRPLANES 结尾的文本时,<that>
开头的 * 匹配 YES 的输入。还要注意使用大写字母指定 <pattern>
文本和 <that>
文本的可选 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 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>
<pattern>YES</pattern>
<that>Hi i am aviator wanna talk about boeing airplanes</that>
<that>Hello how are you what about discuss boeing airplanes</that>
<that>Well hello wanna talk about boeing airplanes</that>
<that>Well hello wanna talk about boeing airplanes</that>
<that>Hey there could we talk about boeing airplanes</that>
<that>What about talk of airplanes</that>
<template>OK then, <set name = "topic">747</set> it will be!</template>
提前致谢。
这是因为在模式中只能有一个'that',而在列表中不能。
但是,您可以做的是设置一个 'topic',然后它就会如您所愿地工作。作为回应,请在任务完成后重新设置主题。
<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>
另一种方法是在 <that>
模式中使用通配符。您的第二个类别将变为:
<category>
<pattern>YES</pattern>
<that>* AIRPLANES</that>
<template>OK then, <set name = "topic">747</set> it will be!</template>
</category>
当 AI 的最后一个响应是任何以 AIRPLANES 结尾的文本时,<that>
开头的 * 匹配 YES 的输入。还要注意使用大写字母指定 <pattern>
文本和 <that>
文本的可选 AIML 约定。