J'ai un meilleur script python si vous êtes intéressé
import aiml
import sys <br>
brainLoaded = False
forceReload = False
while not brainLoaded:
if forceReload or (len(sys.argv) >= 2 and sys.argv[1] == "reload"):
kern.bootstrap(learnFiles="Database.xml", commands="load aiml b")
brainLoaded = True
kern.saveBrain("Cache.brn")
else:
# Attempt to load the brain file. If it fails, fall back on the Reload
try:
# It is our cache file.
kern.bootstrap(brainFile = "Cache.brn")
brainLoaded = True
except:
forceReload = True
# Enter the main input/output loop.
print "Enter your message for the chatbot"
while(True):
print kern.respond(raw_input("> "))
Note: Vous devez créer une base de données de dossier dans lequel vous placez vos fichiers AIML et un fichier Database.xml
Qu'est-ce dans le 'bot.aiml' fichier? –