[Spambayes] How to Display tokenized ham/spam scores?

Sean True seant at iname.com
Wed Aug 20 17:54:06 EDT 2003


The triple is the database status entry. It means that the loop might look
vaguely like:

 for key in indb.keys():
        try:
            nspam, nham = indb[key]
            .. work goes here ..
        except:
            print key, indb[key], type(indb[key]),"**********"
            continue

-- Sean

> -----Original Message-----
> From: spambayes-bounces at python.org 
> [mailto:spambayes-bounces at python.org] On Behalf Of Joerg Beyer
> Sent: Tuesday, August 19, 2003 5:58 AM
> To: Jake
> Cc: SpamBayes at python.org
> Subject: Re: [Spambayes] How to Display tokenized ham/spam scores?
> 
> 
> Jake wrote:
> > Hello there,
> > 
> > How can i display the actual ham/spam scoring for words/tokens
> > ble)?    --- the ones that get written into the hammie.db for
> > classification.
> 
> for the dbm version of the stored you can do this:
> open the dbm file, iterate over the keys (which is the token)
> for each key extract a python object, which is a pickled
> object (for most cases a 2-tuple (ham and spam count
> for the key, sometimes a 3-tuple, but I dont know yet why)
> 
> So you can extract the ham/spam count for each token (roughly
> a token is a word from a mail plus special words, like how
> many entries have been in the to: and cc: filed of the header).
> 
> > Am interested on how the algorithm works exactly.
> 
> read the source, it is very annotated whith comments that
> say, why something is done.
> 
> 	hope this helps
> 	Joerg
> 
> 
> _______________________________________________
> Spambayes mailing list
> Spambayes at python.org
> http://mail.python.org/mailman/listinfo/spambayes
> 





More information about the Spambayes mailing list