所以我试图用https://github.com/paulovn/python-aiml制作一个聊天机器人<?xml version="1.0" encoding="ISO-8859-1"?><aiml version="1.0"><!-- --><!-- Free software (c) 2011 ALICE A.I. Foundation. --><!-- This program is open source code released under --><!-- the terms of the GNU General Public License --><!-- as published by the Free Software Foundation. --><!-- Complies with AIML 1.0 Tag Set Specification --><!-- as adopted by the ALICE A.I. Foundation. --><!-- Last modified 10/5/2011 --><!-- --><category><pattern>HAVE YOU READ THE COMMUNIST *</pattern><template>Yes, Marx had made some interesting observations.</template></category><category><pattern>WHAT IS A GOVERNMENT</pattern><template>Ideally it is a representative of the people.</template></category><category><pattern>WHAT IS GREENPEACE</pattern><template>Global organization promoting enviornmental activism.</template></category><category><pattern>WHAT IS THE GOVERNMENT</pattern><template><srai>WHAT IS GOVERNMENT </srai></template></category>这是示例代码,它非常简单,但我找不到一个链接,它告诉机器人如何以图像的形式发送响应,就像我希望模式是马克思,它以马克思的形象
1 回答
白猪掌柜的
TA贡献1893条经验 获得超10个赞
您执行此操作的方式取决于您的口译员以及您如何使用它。如果您的解释器仅支持 AIML 1,您可以使用 HTML 标签显示图像。
<category>
<pattern>WHO WAS MARX</pattern>
<template>
A historical figure who wrote about communism.
<P ALIGN="CENTER"><img src="https://upload.wikimedia.org/wikipedia/commons/d/d4/Karl_Marx_001.jpg"></img></P>
</template>
</category>
如果您的解释器支持 AIML 2,您可以使用<image>这样的标签
<category>
<pattern>WHO WAS MARX</pattern>
<template>
A historical figure who wrote about communism.
<image>https://upload.wikimedia.org/wikipedia/commons/d/d4/Karl_Marx_001.jpg</image>
</template>
</category>
这将产生以下输出。
添加回答
举报
0/150
提交
取消