Any Neural Net code in Python? I want to filter out spam email

Dan Maas dmaas at nospam.dcine.com
Wed Apr 18 20:55:08 EDT 2001


> I've been saving up all the spam messages I get for the past two months.
> I have about 1869 spam messages saved.
> Now I'd like to develop a neural net based filter for my email program
> and train it to recognize these messages as spam. 

Cool... I assume the main thing you are worrying about is accidentally
rejecting non-spam emails, which might happen too easily with a 
naive keyword-based system.

How about this - apply a whole set of tests to the message. Each test
gives a "spammness" score - e.g. 10 points for being all caps, 50 points
for having the word 'viagara', 100 points for having a suspicious From:
address like *@yahoo.com. Add the scores from the different tests, and
if the sum exceeds, say, 200 points, then call it "spam."

So, how do you figure out a good value for each test score? This is where
you could use a neural network or genetic algorithm. Pick a set of
scores, feed the program lots of messages (both spam and non-spam), and 
see how accurate it is. Iterate until it rejects every spam email and
accepts every non-spam...

Dan



More information about the Python-list mailing list