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插件
- 下一篇: [tomcat]-tomcat8安装ap