BOT libre does not currently support the learn tag (it is not part of AIML 1.0).
If you have learning enabled, the bot will always learn. If correction is enabled, then any user can correct any response by clicking correction.
The first script seems to attempt to learn facts. AIML has no concept of knowledge, so does things in a odd way sometimes. BOT libre has a knowledgebase, so learning facts is easy. The "NounVerbAdjective" bootstrap script can learns any facts about anything, and remembers them persistently. i.e. "I am tall" it will understand and remember that you are tall. Even if you log back in next week (with the same user id) it will still remember. Or, "The sky is blue", it will learn that the sky is blue, and be able to answer "Is the sky blue?" without having to have any new responses, it only uses the "NounVerbAdjective" and its knowledgebase.
The second script seems to do what correction already does. You can also define a Self script for this. I added one here,
WrongAnswer.
// This script listens for "wrong" or "wrong answer" and asks for a correction, and learns the new response.
State:WrongAnswer {
case :input goto State:sentenceState for each #word of :sentence;
State:sentenceState {
case "wrong" goto State:wrongState;
case "bad" goto State:wrongState;
case "incorrect" goto State:wrongState;
pattern "*"
that "Sorry, what should I have said?"
goto State:learnNewResponseState;
State:wrongState {
case "answer" goto State:wrongAnswerState;
case "reply" goto State:wrongAnswerState;
case "response" goto State:wrongAnswerState;
Quotient:1.00:Equation:wrongAnswer;
Equation:wrongAnswer {
"Sorry, what should I have said?";
}
State:wrongAnswerState {
Quotient:1.00:Equation:wrongAnswer;
}
}
State:learnNewResponseState {
case :anything goto State:learnNewResponseState;
Quotient:1.00:Equation:learnNewResponse;
Equation:learnNewResponse {
assign :correction to (get #input from (get #input from :conversation at last 1));
assign :question to (get #input from (get #input from :conversation at last 5));
assign :response to (get #input from (get #input from :conversation at last 4));
associate :question to :correction by #response;
dissociate :question to :response by #response;
Formula:"Okay, I will answer ""{:star}"" next time.";
}
}
}
}
|