我最近使用 python 进行了目标,我尝试了最简单的程序,但即使这样似乎也给我带来了问题,我不知道为什么。
这是python脚本:
import aiml
kernel = aiml.Kernel()
kernel.learn("std-startup.xml")
kernel.respond("load aiml b")
while True:
print (kernel.respond(raw_input("Enter your message >> ")))
这是 std-startup.xml 的内容:
<category>
<pattern>
LOAD AIML B
</pattern>
<template>
<learn>basic-chat.aiml</learn>
</template>
</category>
这是 basic-chat.aiml 的内容:
<category>
<pattern>HELLO</pattern>
<template>
Well, hello!
</template>
</category>
<category>
<pattern>WHAT ARE YOU</pattern>
<template>
I'm a bot, silly!
</template>
</category>
我收到此错误警告:找不到输入匹配项:加载目标 b。
我以前见过一些人与他们打交道,我已经尝试过他们的解决方案,但似乎没有任何效果。提前感谢您提供的任何智慧