Question

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?

Was it helpful?

Solution

OTHER TIPS

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.

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top