AI Zone Admin Forum Add your forum

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

learnf tag in Program AB

I am using Program AB as a library in a Java application.  My problem is how to use learnf.  I can add the following category to an aiml file in Pandorabots and things work just as the AIML spec says.

(you’ll have to take my word for the correctness of the category as it is the one in the documentation.  AIML doesn’t seem to work when I try to put it in here as the preview doesn’t reproduce what I write and randomly omits tags.)

A file is written containing the learned category in a file with the name in the Learn-filename and the category is remembered and available.  Pandorabots follows the spect exactly.

This doesn’t seem to happen with Program AB.  The remembered category is saved in a CSV file in the aimlif subdirectory but the corresponding AIML file is never created.  The problem seems to be with what is chosen for the action argument in the Bot constructor.  Either the “remembered” category is never used, or it is the only category ever loaded.

Any suggestions or references to documentation would be greatly appreciated.


  [ # 1 ]

It seems like I have to get completely puzzled, find an appropriate website, and post a plea for help before the answer occurs to me.  Apparently Program AB never creates an AIML file with the learned categories in it.  What is learned seems to be only saved in the aimdif directory in a CSV file.  Now depending upon whether you use “csv2aiml”, “aiml2csv” or an empty string as the action argument for the Bot class constructor, you either get categories from the CSV files, from loading the AIML files, but never booth.  The solution is two fold.  First only use the empty string as the action, or just use the version of the Bot constructor which doesn’t have an action argument.  The second is to add a single line of code to the Bot class, which is a call to the method addCategoriesFromAIML() after line 162 in in the Program AB source code.  This leg of the if() tree will be taken when there is no action argument.  All the AIML files will be loaded and all categories saved in the CSV files in the aimlif directory will also be loaded.  Then learnf will work as advertised, with the exception that no new AIML file will be created with the learned categories.


  [ # 2 ]

I m also stuck in this when debugging the code I got to know that nodeName.equals(“template”) always remain true in file that’s why learn method not called.
if (doWrites) {
this condition is also true. But category is blank.  :(


  [ # 3 ]

Issue resolved… just refer learn.aiml file.


  login or register to react