AIML相关内容学习整理
生活随笔
收集整理的这篇文章主要介绍了
AIML相关内容学习整理
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
关键词:Artificial Intelligence Markup Language、XML语言、Richard Wallace
关于安装:
1.安装Python
2.pip install aiml
关于使用【例子:创建一个AIML对话过程】:
1.创建任一个项目文件夹
2.创建std-startup.xml文件【固定】
<aiml version="1.0.1" encoding="UTF-8"><category><pattern>LOAD AIML B</pattern><template><learn>basic_chat.aiml</learn></template></category> </aiml>3.创建上文中的basic_chat.aiml资源文件
<aiml version="1.0.1" encoding="UTF-8"><category><pattern>1</pattern><template>12?</template></category><category><pattern>2*</pattern><template>2345?</template></category><category><pattern>*谢谢*</pattern><template>不客气,嘻嘻~</template></category> </aiml>4.创建对话执行的Python文件
import aiml k=aiml.Kernel() k.learn("std-startup.xml") k.respond("LOAD AIML B") while True:print(k.respond(input("input >> ")))5.关于报错:
AttributeError: module 'time' has no attribute 'clock'
解: Python3.8 不再支持time.clock,用 time.perf_counter() 来替换即可。
来源:AttributeError module ‘time‘ has no attribute ‘clock‘ 解决方法_叶庭云 成为自己的光-CSDN博客‘
6.其他参考【链接中有些源码中错误,要自我甄别修正】:
AIML环境安装设置 - AIML 教程 | BootWiki.com
Python 的 AIML_shuifu1988的博客-CSDN博客
mirrors / WangXiaoCao / PyAIML · GIT CODE
AIML框架学习(一) - 云+社区 - 腾讯云 (tencent.com)
总结
以上是生活随笔为你收集整理的AIML相关内容学习整理的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: PHPSTORM插件
- 下一篇: AIML应答机器人(一)aiml简介