前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >python aiml标签用法

python aiml标签用法

作者头像
用户5760343
发布2019-09-27 11:07:06
4600
发布2019-09-27 11:07:06
举报
文章被收录于专栏:sktjsktj
代码语言:javascript
复制
aiml文件标签:
 1
 <aiml>
Defines the beginning and end of a AIML document.
2
 <category>
Defines the unit of knowledge in Alicebot's knowledge base.
3
 <pattern>
Defines the pattern to match what a user may input to an Alicebot.
4
 <template>
Defines the response of an Alicebot to user's input.
<star>
Used to match wild card * character(s) in the <pattern> Tag.
<srai>
Multipurpose tag, used to call/match the other categories.
<random>
Used <random> to get random responses.
<li>
Used to represent multiple responses.<set>
Used to set value in an AIML variable.
6
 <get>
Used to get value stored in an AIML variable.
7
 <that>
Used in AIML to respond based on the context.
<topic>
Used in AIML to store a context so that later conversation can be done based on that context.
<think>
Used in AIML to store a variable without notifying the user.
<condition>
Similar to switch statements in programming language. It helps ALICE to respond to matching input.
<category>
 <pattern> A * is a *. </pattern>
<template>
 When a <star index = "1"/> is not a <star index = "2"/>?
 </template>
</category>
<?xml version = "1.0" encoding = "UTF-8"?>
 <aiml version = "1.0.1" encoding = "UTF-8"?>
<category>
 <pattern>I LIKE *</pattern>
 <template>
 I too like <star/>.
 </template>
 </category>
<category>
 <pattern>A * IS A *</pattern>
 <template>
 How <star index = "1"/> can not be a <star index = "2"/>?
 </template>
 </category>
</aiml>
<?xml version = "1.0" encoding = "UTF-8"?>
 <aiml version = "1.0.1" encoding = "UTF-8"?>
 <category>
 <pattern> WHO IS ALBERT EINSTEIN </pattern>
 <template>Albert Einstein was a German physicist.</template>
 </category>
<category>
 <pattern> WHO IS Isaac NEWTON </pattern>
 <template>Isaac Newton was a English physicist and mathematician.</template>
 </category>
<category>
 <pattern>DO YOU KNOW WHO * IS</pattern>
 <template>
 <srai>WHO IS <star/></srai>
 </template>
 </category>
 </aiml>
<?xml version = "1.0" encoding = "UTF-8"?>
 <aiml version = "1.0.1" encoding = "UTF-8"?>
 <category>
 <pattern>WHAT ABOUT MOVIES</pattern>
 <template>Do you like comedy movies</template>
 </category>
<category>
 <pattern>YES</pattern>
 <that>Do you like comedy movies</that>
 <template>Nice, I like comedy movies too.</template>
 </category>
<category>
 <pattern>NO</pattern>
 <that>Do you like comedy movies</that>
 <template>Ok! But I like comedy movies.</template>
 </category>
</aiml>
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019.09.26 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档