Hello all,

I am looking at AI::Categorizer because I need to implement a bayesian
filter for a project. This module seems to do what I need...except for one
thing:

In this module the training corpus seems to be an
AI::Categorizer::KnowledgeSet object. Such a knowledgeset can be used to
train a learner.
There are methods for adding documents (with categories) to the
knowledgeset, but I can't find anything to correct the documents in this
knowledgeset. I want to be able to correct documents by changing their
categories, so this knowledgeset can be used to train the learner again.
I would like to use the KnowledgeSet->save_state method to save it to disk.
Is this possible or must I create the knowledgeset anew everytime (from the
original, but corrected data)?

I encountered another problem, but this could also be a problem in the
"Storable" module which is used by AI::Categorizer.
Heres an example that displays my problem:

print "Loading knowledge set\n";
my $k =
AI::Categorizer::KnowledgeSet->restore_state($savepath.'knowledgeset');
foreach my $docobj ( $k->documents() ){
  print $docobj->name."\n";
}
# this fails: Can't locate object method "name" via package
"AI::Categorizer::Document::Text"
# while this succeeds:
foreach my $docobj ( $k->documents() ){
  print $docobj->AI::Categorizer::Document::name."\n";
}

For some reason the inherited methods are not available anymore in the
restored document object. Anyone know if this is normal?

This AI stuff is pretty new to me, so feel free to point out any errors or
more effecient solutions.

Thanks for reading this,

Merijn van den Kroonenberg


Reply via email to