Grokbase Groups Perl ai January 2004
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

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 =
foreach my $docobj ( $k->documents() ){
print $docobj->name."\n";
# this fails: Can't locate object method "name" via package
# 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

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupai @
postedJan 28, '04 at 8:46p
activeJan 28, '04 at 8:46p

1 user in discussion

Merijn van den Kroonenberg: 1 post



site design / logo © 2021 Grokbase