AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

learnf
 
 

Hello. I’m trying out the new aiml2.0 on Playground Beta website and was wondering if someone could explain to me how to use learnf (or learn for that matter).
I read in the tutorial about it and it gave an example, however I didn’t quite understand the example.

What i’d like to do in the long run is be able to use learnf to create a new card that remembers what the user taught it. My question is this, is there a way to write a piece of code so it will learn “anything” the user tells it to learn? Or do I have to write specific pieces of code for each possible category?

Approaching the question another way..
The tutorial example looks like this
<category>
THE SKY IS BLUE</pattern>
<template>I will remember that the sky is blue
<learn>
<category>
WHAT COLOR IS THE SKY</pattern>
<template>The sky is blue</template>
</category>
</learn>
</template>
</category>

I’m assuming this is specifically talking about the sky being blue so the bot is now able to learn that the sky is blue, but that’s it, yes? If I wanted the bot to learn about ANYTHING else i’d have to make similar categories about them?

 

 
  [ # 1 ]

You need to teach the bot how to learn. Not each possible category but the different styles of input eg, “x is y. What is x?”

An example category for your input of “The sky is blue” could be:

<category>
 <
pattern>THE IS *</pattern>
 <
template>OkI will remember that.
<
think>
 <
learn>
 <
category>
  <
pattern>
         
WHAT IS THE <eval><uppercase><star index="1"/></uppercase></eval>
  </
pattern>
  <
template>
  
It is <eval><star index="2"/></eval>.
  </
template>
 </
category>
 </
learn
</
think>
 </
template>
</
category

Human: The sky is blue.
Bot: Ok, I will remember that.
Human: The dog is barking.
Bot: Ok, I will remember that.
Human: What is the sky?
Bot: It is blue.
Human: What is the dog?
Bot: It is barking.

I created a file that has a few examples at http://www.square-bear.co.uk/aiml/ (scroll down to learn.aiml)

Take a look at that and I will be happy to help with any further questions.

 

 
  [ # 2 ]

Thank you! I think I understand now. I will look at the file and go from there!

 

 
  [ # 3 ]

Steve - how do I maintain the “learned facts” for my bot using <learn> in your learn.aiml?  I expected this information to be stored in Pand_learn.aiml or is this just for <learnf>.  How are these facts different from client_profile predicates?  As botmaster I would like to moderate and maintain leaned facts entered by users.  Thanks & regards, Greg

 

 
  [ # 4 ]

Sorry Greg but only the <learnf> facts are added t the learn file. If you use <learn>, they are created in memory and flushed when the server gets a restart. Unfortunately, you can’t see the <learn> facts, so what I do is to have Mitsuku email me every time <learn> is called. That way I can decide whether to keep the facts or discard them.

I would advise using learnf if you want to see what facts your users have taught your bot. Be warned though, the vast majority (and I mean around 95%) will be utter rubbish.

 

 
  login or register to react