[Spambayes] big imapfilter.py problem

David Abrahams dave at boost-consulting.com
Sun Apr 27 22:59:46 EDT 2003


David Abrahams <dave at boost-consulting.com> writes:

> "Meyer, Tony" <T.A.Meyer at massey.ac.nz> writes:
>
>>> What's happening here is in:
>>> 
>>>   File "spambayes/message.py", line 118, in _getState
>>>     (msg.c, msg.t) = self.db[msg.getId()]
>>> 
>>>    self.db[msg.getID()]
>>> 
>>> is a email.Message object
>> [...]
>>
>> TimS might have a better idea, but I *think* that this is a result of
>> the message db being fixed ;)  The db used to store message objects, and
>> now stores a tuple of the classification and training information.  So
>> self.db[msg.getID()] should return a tuple, *not* an email object.
>>
>> Delete (or rename) your message database and this should work.  (This
>> won't effect your classification database, just the memory of which
>> messages have been classified/trained, which was inaccurate anyway).
>
> What's a message database, and where do I find it?
> OK, I presume spambayes.messageinfo.db is it.
>
>> Apologies for this - we should have realised that old (message)
>> databases would become invalid and need to be removed and posted a
>> message to that effect.
>
> No problem;  just let me know if I've got the details about how to get
> out of it right.

Okay, training worked, but:

%python imapfilter.py -c
Traceback (most recent call last):
  File "imapfilter.py", line 661, in ?
    run()
  File "imapfilter.py", line 651, in run
    imap_filter.Filter()
  File "imapfilter.py", line 526, in Filter
    self.unsure_folder)
  File "imapfilter.py", line 451, in Filter
    evidence=True)
  File "./spambayes/classifier.py", line 217, in chi2_spamprob
    clues = self._getclues(wordstream)
  File "./spambayes/classifier.py", line 441, in _getclues
    prob = self.probability(record)
  File "./spambayes/classifier.py", line 301, in probability
    assert hamcount <= nham
AssertionError
%

What's the problem now?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Spambayes mailing list