J'ai installé AIML par pip et écrivis fichiers startup.py, std-startup.xml, basic.aiml et bot_brain.brn dans noyau dossier. Lorsque je tente de lancer startup.py, je reçois cet avertissement:Impossible de charger les modèles dans AIML via Python
Loading std-startup.xml... done (0.06 seconds)
WARNING: No match found for input: load aiml b
Kernel bootstrap completed in 0.10 seconds
Saving brain to core/bot_brain.brn... done (0.00 seconds)
Ceci est le contenu de std-startup.xml:
<aiml version="1.0.1" encoding="UTF-8">
<!-- std-startup.xml -->
<category>
<pattern>load aiml b</pattern>
<template>
<learn>basic.aiml</learn>
</template>
</category>
</aiml>
Ce script Python est:
import aiml
import os
kernel = aiml.Kernel()
if os.path.isfile("core/bot_brain.brn"):
kernel.bootstrap(brainFile = "core/bot_brain.brn")
else:
kernel.bootstrap(learnFiles = "std-startup.xml", commands = "load aiml b")
kernel.saveBrain("core/bot_brain.brn")
while True:
msg = raw_input(">")
if msg == "exit":
exit(0)
elif msg == "save":
kernel.saveBrain("core/bot_brain.brn")
else:
bot_response = kernel.respond(msg)
print("bot: " + bot_response)
Pour chaque entrée, j'obtiens l'erreur No match found for input
. Qu'est-ce que je fais mal? Tout est dans le même répertoire, sauf le bot_brain.brn.