加入收藏 | 设为首页 | 会员中心 | 我要投稿 汽车网 (https://www.0577qiche.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 教程 > 正文

AIML <think>标签介绍

发布时间:2023-09-19 14:34:20 所属栏目:教程 来源:
导读:<think>标签在aimL中用于存储变量而不通知用户。

语法

使用<think>标记存储值 -

<think>
<set name = variable-name> variable-value </set>
</think>
例如,请考虑以下对话。

Human: My name is
<think>标签在aimL中用于存储变量而不通知用户。

语法

使用<think>标记存储值 -

<think> 
   <set name = variable-name> variable-value </set>
</think>
例如,请考虑以下对话。

Human: My name is Mahesh
Robot: Hello!
Human: Byeee
Robot: Hi Mahesh Thanks for the conversation!
示例

在D:/software/ab/bots/test/aiml目录中创建一个文件:think.aiml,并在D:/software/ab/bots/test/aimlif目录中创建一个文件:think.aiml.csv。

文件:think.aiml

<?xml version = 1.0 encoding = UTF-8?>
<aiml version = 1.0.1 encoding = UTF-8?>
   <category>
      <pattern>My name is *</pattern>
      <template>
         Hello!<think><set name = username> <star/></set></think>
      </template>  
   </category>  
   <category>
      <pattern>Byeee</pattern>
      <template>
         Hi <get name = username/> Thanks for the conversation!
      </template>  
   </category>  
</aiml>
文件:think.aiml.csv -

0,My name is *,*,*, Hello! <think><set name = username> <star/></set></think>,think.aiml
0,Byeee,*,*, Hi <get name = username/> Thanks for the conversation!,think.aiml
执行程序

打开命令提示符。 进入目录:D:/software/ab 并键入以下命令 -

java -cp lib/Ab.jar Main bot = test action = chat trace = false
执行上面示例代码,得到以下结果 -

Human: My name is Mahesh
Robot: Hello!
Human: Byeee
Robot: Hi Mahesh Thanks for the conversation!
 

(编辑:汽车网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章