4

I am developing a small AIML engine, and I am having difficulty understanding what the <learn> tag is for.

If I understand correctly, it's merely to point to an external AIML resource that can be integrated into the current ruleset?

Jean Azzopardi
  • 2,289
  • 23
  • 36

3 Answers3

4

Yes, that's correct.

See: Artificial Intelligence Markup Language 1.0.1 Spec

Bravax
  • 10,453
  • 7
  • 40
  • 68
  • Thanks, however, with fiurther research I found out that it's possible to embed aiml rules inside Learn tags, and use them, as done in learn.aiml on this site : http://www.square-bear.co.uk/aiml/ However, it's not Vanilla AIML. It's exactly what I need though, so my home made parser is now learning with those rules. That said, I'm still accepting your answer, as it is correct. 10x. – Jean Azzopardi Dec 03 '09 at 10:49
2

The learn tag reloads the specified AIML files. For example, if a developer changes some AIML files while the chatterbot is being executed, then the developer can tell the chatterbot to reload. The files will only be reloaded if you have this line:

<category>
    <pattern>RELOAD AIML FILES</pattern>
    <template>
        Okay.
        <think>
            <learn>./aiml/*.aiml</learn>
        </think>
    </template>
</category>

The bot can be made to reload specific AIML files, all files, or a set of AIML files. The learn tag is usually placed inside of think tags.

Greg
  • 2,163
  • 1
  • 21
  • 23
0

The <learn> tag has gone through some evolution. Originally it meant "load an AIML file". Later Pandorabots used the <learn> tag so that the bot can be taught new categories on the fly through conversation. The <learn> tag and its companion <learnf> have been incorporated into the AIML 2.0 spec. See https://docs.google.com/document/d/1wNT25hJRyupcG51aO89UcQEiG-HkXRXusukADpFnDs4/pub