sb_imapfilter.py AssertionError: hamcount <= nham
Hi, When I classify through sb_imapfilter.py, I am getting an AssertionError. Any ideas? I am using spambayes from CVS; courier IMAP; python 2.2.2; and a fresh database. See below for commands. Thanks -Tony [tony ~]$ rm hammie.db spambayes.messageinfo.db [tony ~]$ /usr/bin/sb_imapfilter.py -t SpamBayes IMAP Filter Beta1, version 0.1 (September 2003), using SpamBayes IMAP Filter Web Interface Alpha2, version 0.02 and engine SpamBayes Beta2, version 0.2 (July 2003). Loading state from hammie.db database hammie.db is a new database Loading database hammie.db... Done. Training Training ham folder INBOX.Ham ************** 14 trained. Training spam folder INBOX.Spam ******************************************** 44 trained. Persisting hammie.db state in database Training took 2.87554502487 seconds, 58 messages were trained [tony ~]$ /usr/bin/sb_imapfilter.py -c SpamBayes IMAP Filter Beta1, version 0.1 (September 2003), using SpamBayes IMAP Filter Web Interface Alpha2, version 0.02 and engine SpamBayes Beta2, version 0.2 (July 2003). Loading state from hammie.db database hammie.db is an existing database, with 44 spam and 10 ham Loading database hammie.db... Done. Classifying *.Traceback (most recent call last): File "/usr/bin/sb_imapfilter.py", line 821, in ? run() File "/usr/bin/sb_imapfilter.py", line 811, in run imap_filter.Filter() File "/usr/bin/sb_imapfilter.py", line 676, in Filter self.unsure_folder) File "/usr/bin/sb_imapfilter.py", line 595, in Filter evidence=True) File "/usr/lib/python2.2/site-packages/spambayes/classifier.py", line 158, in chi2_spamprob clues = self._getclues(wordstream) File "/usr/lib/python2.2/site-packages/spambayes/classifier.py", line 395, in _getclues prob = self.probability(record) File "/usr/lib/python2.2/site-packages/spambayes/classifier.py", line 242, in probability assert hamcount <= nham AssertionError
Tony> When I classify through sb_imapfilter.py, I am getting an Tony> AssertionError. Any ideas? That indicates a corrupt database. Do you ever kill sb_imapfilter.py without giving it a chance to clean up properly or run two SpamBayes applications which might both want to write to the same database (say, sb_server.py or sb_filter.py as well as sb_imapfilter.py)? If so, you'll need to figure out a way to avoid that. To work around the problem, I suggest you zap your training database and start from scratch. If you don't solve the underlying problem you'll probably encounter it again. Skip
At 5:39 PM -0600 11/30/03, Skip Montanaro wrote:
Tony> When I classify through sb_imapfilter.py, I am getting an Tony> AssertionError. Any ideas?
That indicates a corrupt database. Do you ever kill sb_imapfilter.py without giving it a chance to clean up properly or run two SpamBayes applications which might both want to write to the same database (say, sb_server.py or sb_filter.py as well as sb_imapfilter.py)?
Nope, I am running everything in sequence. The sequence of commands I showed zapped the database right before training. I'm guessing that sp_imapfilter.py and Courier IMAP don't work nicely together (yet). -Tony
Tony> I'm guessing that sp_imapfilter.py and Courier IMAP don't work Tony> nicely together (yet). I'm guessing that Remi's admonition to use -f is the cause. Skip
participants (2)
-
Skip Montanaro -
Tony Lownds