Slashdot Mirror


Bayesian Filtering For Dummies

Dynamoo writes "Bayesian filtering for spam is awfully clever stuff, touched on by Slashdot several times before. There's a very accessible article at BBC News explaining in fairly simple terms the drawbacks of current keyword-based filtering. It's slightly ironic that the BBC, through the commissioning of Monty Python, also gave 'spam' its name. Those Vikings have a lot to answer for."

74 of 281 comments (clear)

  1. Yes, we must filter out the dummies by Anonymous Coward · · Score: 5, Funny

    I suggest Slashdot immediatly implement this "Bayesian Filter for Dummies" to remove most of the trolls, etc.

    1. Re:Yes, we must filter out the dummies by Anonymous Coward · · Score: 3, Funny

      Wiping out all of the comments just because of the trolls seems a bit extreme.

    2. Re:Yes, we must filter out the dummies by zoikes · · Score: 5, Interesting

      The moderation system (esp. in its current form - moderation by +karma /.ers) will always be better than automated filtering.

      The key problem is adaptation. "Bayesian filtering is better than simple keyword filtering, but its performance will degrade over time unless its rules are continuously updated (via analysis of new data). And there's the problem that a troll in one story context may be an insightful comment in another.

      Moderation by humans apapts rapidly, accomodates a variety of contexts, and will reflect (and grow with) the overall /. "culture".

    3. Re:Yes, we must filter out the dummies by dJCL · · Score: 5, Interesting

      I've been using a baysian spam filter for months now and I understand how they work... Even thou people find the comment funny, a baysian troll filter on slashdot would work...

      If you were to run every slashdot post throu my mail filter as an e-mail message and properly mark the trolls and others you don't want, and the ones you do want, suddenly you would only get the actual good posts, trolling would die quickly... And because of the user classification system currently in place, slashdot has a huge db to build up the word stats, so it could happen immediatly or faster...

      Seriously, I ask that the slashdot admins consider adding this to slashcode... even if slashdot does not use it, others would... there are too many trolls out there as it is on the net and many people put them only a few rungs higher than spammers on the evolutionary ladder(but lower than an ameoba still)

      The logic behind this can actually be extended, to allow a user to start filtering stories so that they only get ones that interest them, or even to filtering submissions to get rid of the cruft, how often to you think that the trolls post troll story submissions? Save work for the site admins...

      I'm curious if an extension of this idea is how Google News works... anyone know?

      Enjoy.

      --
      On Arrakis: early worm gets the bird. Magister mundi sum!
    4. Re:Yes, we must filter out the dummies by Fembot · · Score: 2, Redundant

      Actualy you might joke about this, but I think that having an optional bonus given (As with the current karma bonus) for messages that arent likely to be classified as Troll, offtopic or reduntant might be quite helpful for casual readers.

      It would work based on the moderations of comments for the learning, and of course the bonus would be totaly userdefinable so you could set it to 0 and it would have no effect.

      Just my thoughts on the issue

    5. Re:Yes, we must filter out the dummies by dark-br · · Score: 3, Funny

      Would it work for editors too? If so *please* implement it!

    6. Re:Yes, we must filter out the dummies by milkmandan9 · · Score: 2, Funny
      I suggest Slashdot immediatly implement this "Bayesian Filter for Dummies" to remove most of the trolls, etc.
      So, tell me...would anyone be left?

      Didn't think so.
    7. Re:Yes, we must filter out the dummies by Drakin · · Score: 2, Insightful

      Unfortanatly there's also the problem with some uneducated people with mod points who can't tell the differnce between a truely insightful post and one that is a well written troll. Nor, the people who confuse a troll with humor that's on topic in terms of a given discussion.

      So while it works, there's still some holes in the system.

    8. Re:Yes, we must filter out the dummies by bluelan · · Score: 5, Insightful
      This wouldn't work.

      Baysian filters for spam work because spam has a significantly different vocabulary distribution than useful e-mail. This is true because spam must deliver a commercial message and play on people's uncertainties.

      Good trolls, on the other hand, look ALMOST like insightful, well written articles. The vocabulary distribution in good trolls is not significantly different than the vocabulary distribution of useful posts. So, Baysian filters would be useless, unless you come up with some smarter characteristics on which to train the filter.

      You could easily develop a filter for ascii-art porno. But, those are offtopic or flaimbait, not trolls.

      --

      I used to be a narrator for bad mimes. (wright)

    9. Re:Yes, we must filter out the dummies by DeadSea · · Score: 4, Interesting
      Bayesian filters for email really only work because spammers can't see which messages you classify as spam. If you implemented a bayesian filter for trolls on slashdot, the trolls would see what words constitute a troll and stop using those words. They would stuff their messages with non-troll words avoiding the bayesian filter.

      The same thing would happen to your mail if the words that your bayesian filter were the same as the words in everybody else's. Spammers would be able to see what make an email seem spamming and they wouldn't do that. Bayesian filtering works for email right now because everybody's filters are a bit different. There is currently no magic bullet to get through everybody's spam filters. Also spammers cannot see your filter so they don't know if their message was filtered. If you opened your archive to me, I could quite easily craft a spam that would land square in your inbox.

    10. Re:Yes, we must filter out the dummies by bluGill · · Score: 2, Interesting

      Ahh, but a troll that looks genuine at first, and appears on topic is worth a reading for the laugh. It needs to be marked funny, and depending on how good it is might need some explination in a followup post to keep those not in the know from thinking the wrong thing.

      OTOH, first post is always useless and a waste of time. So are a few other posts. ASCI-art might be easy to filter, but can you filter the porn ascii-art without blocking the guy trying to make a diagram of some sort so we can better understand what is going on?

  2. A bit of info on Bayesian filtering by jat850 · · Score: 5, Informative

    The BBC article mentions Paul Graham, and I found his page (and some more information on Bayesian networks for spam filtering) here:

    Paul Graham's spam page

    He talks a little bit more about the technical aspects there.

    --
    the blood has stopped pumping, and he's left to decay
    the me that you know is now made up of wires
    1. Re:A bit of info on Bayesian filtering by Rosco+P.+Coltrane · · Score: 2, Informative

      From Paul Graham's page :

      A probability can of course be mistaken, but there is little ambiguity about what it means, or how evidence should be combined to calculate it. Based on my corpus, "sex" indicates a .97 probability of the containing email being a spam, whereas "sexy" indicates .99 probability. And Bayes' Rule, equally unambiguous, says that an email containing both words would, in the (unlikely) absence of any other evidence, have a 99.97% chance of being a spam.

      Tough filter for users of dating services who happen to be gynecologists ...

      --
      "A door is what a dog is perpetually on the wrong side of" - Ogden Nash
    2. Re:A bit of info on Bayesian filtering by letxa2000 · · Score: 5, Insightful
      A gynecologist probably wouldn't have a corpus that indicates that "sex" is a .97 spam probability. That's the great thing about Bayesian: the spam probability for each word depends on the mail and spam YOU receive. It works dang well, just as Paul Graham claims. I'm averaging 99.7% accuracy this week, and the one spam that got through was written in German.

    3. Re:A bit of info on Bayesian filtering by GnuVince · · Score: 5, Insightful
      No, because if they have a lot of legitimate mails with words like "sex", "sexy", "penis", "vagina", "viagra", etc., the filter will adapt. That's the whole point. For PG, "sexy" is a sure sign of spam, but for a sexologist, it is not. You train the filter to recognize your spam. So if "sex" appears as much in your legitimate mail than in your spam, "sex" will not be considered a trace of a spam.

      Bayesian filters adapt, that's why they work so well.

  3. It's not bad... by Sheetrock · · Score: 2, Interesting

    I've been using it for a bit on my own e-mail, and it seems to work out. But it's not at the point where I'd be happy to see ISPs implementing it for their customers -- even ignoring the Freedom of Speech issue, it still has the occasional false positive.

    --

    Try not. Do or do not, there is no try.
    -- Dr. Spock, stardate 2822-3.




    1. Re:It's not bad... by letxa2000 · · Score: 2, Insightful
      The question is, which produces more false positives: The occasional Bayesian false positive, or the occasional (or not so occasional) good mail that you'll accidentally delete when you're deleting 150 spams per day? If I'm getting 150 spams per day that's 1050 spams per week which is an awful lot of "deletes." You don't think you're going to accidentally throw out a good message now and then when manually deleting that much spam? I'd venture to say that you'll probably accidentally delete more yourself by accident than Bayesian will toss as false positives.

    2. Re:It's not bad... by pyr0 · · Score: 2, Informative

      That's exactly how spamassassin works. My school has it set up on their exchange servers. The problem with that is...you still get the spam. So even if it does go in another folder, which in turn still wastes your bandwidth and time in deleting it, as far as the spammer knows it went through. The still gets paid for having sent out a successful spam. The only real advantage is being able to read your legit messages without sorting through the spam, and even that is starting to become an issue because it seems the spammers have become much smarter. Thus, I still get around 10 spams a day in my main inbox...although that is still an improvement from the actual 100 plus or minus a day I actually get. I still like the idea of those spam tarpits restricting the bandwidth from known spam domains. All email gets through eventually...which isn't a problem for most normal messages. It is a problem though when the spammers suddenly find their connection to remote mail servers throttled and can't send all they want to in as little time as it would normally take.

  4. Origin of SPAM by brejc8 · · Score: 2, Interesting

    It's slightly ironic that the BBC, through the commissioning of Monty Python, also gave 'spam' its name.
    Does anyone have proof thats where the name comes from?

    1. Re:Origin of SPAM by jat850 · · Score: 5, Informative

      Good question ... through Google Groups I found this page.

      --
      the blood has stopped pumping, and he's left to decay
      the me that you know is now made up of wires
    2. Re:Origin of SPAM by Anne+Thwacks · · Score: 4, Informative
      While the Monty Python sketch may have inspired the use of the term, the Monty Python usage was in fact a rehash of a sketch by Peter Sellers, dating back to the 1950's which referred to the wartime situation where Cafe's often had fancy things on the Menu, but when you came to order, the item in question was not available.

      The sketch is to be found on the album "The Bset of Sellers" - probably released in about 1958, and which also features the nursery rhyme

      "Up on the chair behind the door,
      hey diddle, diddle,
      Hear comes Poppa
      so up with the chopper
      and split 'im down the middle

      And "Balham, gateway to the South" a spoof of the travalogue films that often apepared in the cenema at the time.

      --
      Sent from my ASR33 using ASCII
  5. Dialect or typo? by isomeme · · Score: 2, Funny
    From the article's subhead:
    just as paper junk mail buried many a front door map
    Is that yet another weird British idiom, or simply a typo for "mat"?
    --
    When all you have is a hammer, everything looks like a skull.
  6. More Spam! by James+Littiebrant · · Score: 3, Insightful

    I have used a bayesian filter for some time now and while it is the BEST filter type I have ever used nothing is 100% reliable. While this is the best technology for the average user it is most cirtainly not perfect. Instead I use a combination of moderate bayesian filtering and good old fasion "block sender" filtering.

  7. Speaking of dummies... by Anonymous Coward · · Score: 5, Informative

    Someone needs to learn the meaning of "ironic". (Hint: it doesn't mean "weird coincidence".)

    Paul

    1. Re:Speaking of dummies... by MechCow · · Score: 2, Funny

      I thought words were defined by how they are used. It would be ironic if you work for webster.

      --

      --
      On Slashdot I'm a lawyer.
  8. Ironic? by popeydotcom · · Score: 4, Funny

    Interesting yes, ironic, no.

    What's your name, Alanis Morissette ?

    1. Re:Ironic? by DavyByrne · · Score: 4, Insightful

      Actually, I've long wondered whether Alanis was quite clever in choosing a title for that song.

      You see, none of the events she describes in the song is an example of irony, making the choice of the title "Ironic," well, ironic.

  9. Reminds me of a story by joelt49 · · Score: 3, Funny

    This whole spam thing reminds me of a story I read while in 7th grade. In it, the postage for sending junk mail was decreased to practically nothing. Then, junk mail buried America. Hundreds of years later, archeologists came back and investigated the remains. Their conclusions about our society are kind of humorous. However, the idea of junk mail burying us when the postage goes way down has kind of been proved with spam. Maybe a small tax for spam wouldn't be a bad idea.

  10. No no no, Bayesian Filtering *OF* Dummies please by corebreech · · Score: 3, Funny

    Thank you for your support.

  11. Do spammer's techniques work on slashdot ? by Rosco+P.+Coltrane · · Score: 4, Funny

    Viagra often spelled V-l-a-g-r-a online

    I-f I t-r-o-l-l l-i-k-e t-h-i-s, w-i-l-l i-t p-a-s-s S-l-a-s-h-d-o-t.'s t-r-o-l-l f-i-l-t-e-r ?

    --
    "A door is what a dog is perpetually on the wrong side of" - Ogden Nash
    1. Re:Do spammer's techniques work on slashdot ? by Anonymous Coward · · Score: 2, Funny

      1. refresh slashdot page once a minute
      2. wait 15 seconds
      3. ???
      f-r-i-s-t p-o-s-t!!!

      i-m-a-g-i-n-e a b-e-o-w-u-l-f c-l-u-s-t-e-r o-f B-a-y-e-s-i-a-n F-i-l-t-e-r-s!

    2. Re:Do spammer's techniques work on slashdot ? by MyHair · · Score: 3, Funny

      S-t-e-p-h-e-n K-i-n-g i-s d-e-a-d a-t 5-2 !

      B-S-D i-s d-y-i-n-g ! N-e-t-c-r-a-f-t c-o-n-f-i-r-m-s i-t !

  12. Wrong pic... by Mondoz · · Score: 4, Informative
    It's slightly ironic that the BBC, through the commissioning of Monty Python, also gave 'spam' its name.

    Why then, does the article show a pic from a Monty Python animation about the black spot who goes to seek his fortune...
    You'd think they'd use the actual pic of the skit with the Vikings in the cafe...

    --
    /sig
  13. Re:who're the vikings? by Evil-G · · Score: 5, Informative

    A group of vikings in a monty python sketch drowned out normal conversation by shouting the word "spam" louder and louder. The word was then adopted for all the crap drowning out normal conversation on usenet.

  14. Hmmm by Anonymous Coward · · Score: 2, Insightful

    So this filter works on analysis of previously filtered mail?

    I can see the casual (mis)use of this technique by your average user rapidly becoming a problem - putting just one email from a legit e-mail sender into the bayesian filter could concievably snowball into a block on a lot of legit traffic under certain circumstances.

    Above and Below knows I have enough hassle with users and their e-mail already

    1. Re:Hmmm by letxa2000 · · Score: 3, Insightful
      I can see the casual (mis)use of this technique by your average user rapidly becoming a problem - putting just one email from a legit e-mail sender into the bayesian filter could concievably snowball into a block on a lot of legit traffic under certain circumstances.

      It's natural to think that is the case, but in reality it isn't. Accidentally putting one email in the wrong corpus ("good" or "spam") will not be enough to kill you. If you consistently fail to put them in the right corpus then over time, yes, things would snowball. But that'll only happen over time. A mistake now and then isn't enough to mess things up.

  15. Re:who're the vikings? by RobotRunAmok · · Score: 2, Insightful

    The Monty Python Comedy troupe did a rather famous (in some Geek circles) skit in which the virtues of canned Spiced Ham are literally sung. Inexplicably, a group of Vikings join in the song.

    The poster, obviously better schooled in British farce than luncheon meats, is under the impression that the widely accepted nickname for unsolicited e-mail is derived from the comedy sketch and not from Spam(tm), the food.

    I don't know for certain if he's wrong, but I have a hunch he is. I'm guessing a lot more people have eaten Spam than have digested the Python skit...

  16. Re:Spam = /dev/null by GammaTau · · Score: 4, Informative

    Bayesian filtering could stop all the spam that easily? This is great! Where can I download a filter like this?

    You can try bogofilter, ifile, SpamBayes, or POPFile. The newer versions of SpamAssassin also implement some kind of Bayesian filtering.

  17. Required Reading by E-mail Users by Shackleford · · Score: 3, Interesting
    This "Bayesian Filtering for Dummies" article, titled "How to spot and stop spam" on the BBC web site, gave much useful information on the problem of spam and the filtering method used to get around it. It is quite comprehensible, as you certainly don't need to know the probability theory behind Bayesian filtering to understand it. It gives useful information on the problem of spam, and I'd say that this sort of article is required reading for all those who use e-mail. Why? Becaus it states this fact:

    "The sheer number of spam mail sent means that even tiny response rates, reportedly 0.0001%, means junk mailers turn a profit. "

    And this is why I say that educating users is just about as important as implementing spam filtering technology. If people know that they are perpetuating a serious problem by replying to spam, then that's bad news for spammers.

    About another fact mentioned in the article: It said Paul Graham's filter extracts "the top 15 features that define them as spam." 15? I thought that most Bayesian filters use many more spam-defining features. Because I'd say that there are quite a few more. Just think of the many features that spam tends to have. But he says his filter works well. Interesting.

    1. Re:Required Reading by E-mail Users by dJCL · · Score: 3, Insightful

      From my understanding of his full explanation(I read it a while ago, can't remember where, dig around some) each e-mail has every word examined and given a rating from 0.01(good) to 0.99(spam), then the 15 words farthest from 0.50 are selected, some averaging is done and if the score is over some threshold(say 0.90) then it is called spam and trashed, I use spamunition for my outlook e-mail(working on moving my e-mail over to linux, hopefully soon, so I can del my windows boxen) and it can give the stats for each e-mail and it appears to use the same formula...

      Part of the reason this all works is that spammers slowly change their wording over time to beat the static filters, but the baysian filter will still catch it on other parts of the message, and add the new wording to the db... the only spam that ever get throu to me now is stuff that is worded exactly like a normal e-mail, and even then they have a hard time, yet all my friends have no problems...

      I think the key here is to(with this software) never delete any e-mail, spam goes to the spam folder, sort the other stuff, and stuff you wanted, but don't need, move to another folder just so allow the filter to know what to look for... I have 5200 spam e-mails saved and about 1000 legit mail saved and my accuracy level is about 99.9...

      Read up on it, this stuff really does work.

      Enjoy

      --
      On Arrakis: early worm gets the bird. Magister mundi sum!
    2. Re:Required Reading by E-mail Users by kindbud · · Score: 2, Interesting

      I have 5200 spam e-mails saved and about 1000 legit mail saved and my accuracy level is about 99.9...

      Yes, but you haven't reduced your exposure to spam. In fact, it looks like now you have to track your spam intake assiduously so as to keep the filter trained. Not many people would consider this an improvement. :)

      --
      Edith Keeler Must Die
  18. I don't receive spam by Rosco+P.+Coltrane · · Score: 4, Interesting

    In my home mailbox, I don't receive spam. And I only got two 419 nigerian invesment frauds on my professional address in a whole year, despite the fact that my corporate email address is widly publicized and easy to find on google. And amazingly, I never receive spam in my "special bogus registration" hotmail account (useful for programs like RealPlayer, or nytimes.com).

    So existing mail filters work for me, more or less. The few unwanted mails that pass through are easily taken care of by my trusted delete button. This leads me to ask :

    - Do other people really receive that much spam, or am I an isolated case ?

    - Do people who receive spam purchase things online, or register software and other services with their real names and email ?

    --
    "A door is what a dog is perpetually on the wrong side of" - Ogden Nash
    1. Re:I don't receive spam by letxa2000 · · Score: 4, Insightful
      There are in fact two big problems with Bayesian filtering (or any content-based filtering) from the perspective of an ISP or company... 1) one person's spam is another person's necessity

      But that's why Bayesian advocates every user having their own Bayesian statistics. It's not a "one size fits all" for the entire ISP or company, as is the case with most keyword filters. Every user has a different set of Bayesian statistics which is why it is very difficult for spammers to get around this filter--they have no way of knowing what words are in each users' statistics.

      2) you still have to waste your bandwidth and CPU before you reject it.

      It's better to waste your bandwidth and your CPU than to waste the time of those receiving the spam. IMHO...

      So Bayesian filters are a good tool of last resort, but there are many other tools that should be used too.

      The quicker everyone uses Bayesian filters (as opposed to waiting until all the other filters are incapable of keeping up with spam) the sooner the spammers will be in trouble. I personally use both a Bayesian filter with an up-to-date blacklist of known spamvertised domains, etc. I find that, quite simply, the simple keyword filters catch spam from known spam sites and Bayesian catches the rest. But if I turned off my normal filters Bayesian would have caught it all since those spams are always assigned a high Bayesian score, too. It almost makes sense to turn off the other filters, but they can be useful if a spammer comes up with a truly unique spam and someone else has already identified the domain name. It's rare, but it can happen. So a combination of technologies is probably the best... but a combination that lacks Bayesian is a combination that could be better.

  19. Apple's Mail app... by useruser · · Score: 4, Interesting

    ...supposedly uses some form of Baysian reasoning. I've been using it for a year now. I trained it for a couple of weeks, turned it on "automatic filtering" mode, and now I can count the number of times its misclassified a message on my two hands. I used to get more spam than legit mail, now I can't help but wonder why spam is a problem for people. Until I remember that most people don't use a mac. Every once in a while, I flip it back into training mode so that I can see the lovely see of brown-colored spam messages that flood my inbox. I flip it back to automatic mode, Mail automatically moves them to my junk folder, and I can forget about them.

    1. Re:Apple's Mail app... by Anonymous Coward · · Score: 5, Informative

      Actually, the latent semantic analysis (LSA) that Apple uses is not a form of Bayesian reasoning; it uses a singular value decomposition (SVD) to perform generalized factor analysis. However, there is a probabilistic version of LSA out there.

  20. Evolution and by Gyorg_Lavode · · Score: 2, Insightful

    I have a simple questions, is there a way to impliment a Bayesian Filter for Evolution without having to add an extra stop for the email, (ie a mail server on my computer from which evolution picks mail up locally).

    --
    I do security
    1. Re:Evolution and by C3ntaur · · Score: 3, Informative

      Yes, I've done it and here's how:

      1. Get and install bogofilter.

      2. Make a shell wrapper script that runs bogofilter in passthrough mode, redirect stdout and stderr to files in /tmp for debugging and training bogofilter. Here's mine:

      #!/bin/bash /usr/bin/bogofilter -p -u > /tmp/bogo.out 2> /tmp/bogo.err
      status=$?
      exit $status

      3. Make a new local mail folder in evolution to collect spam.

      4. Make a filter in evolution that runs the wrapper script. Tools->Filters, choose Incoming, choose Add. Add a criterion that looks like this:
      Pipe message to shell command, (path to your wrapper script), returns, 0. Add an action to move the message to your local spam filter.

      5. Be sure evolution is set to apply filters to new mail in the inbox(es) you want bogofilter to act on. Tools->Settings, choose Mail Accounts, choose desired inbox(es), choose edit, choose the Receiving Options tab, check the Apply filters to new messages in INBOX on this server.

      Please be sure to RTF bogofilter M. You will need to train (and retrain) bogofilter with spam and non-spam samples over time. The switches to do this have CHANGED from version to version. If you have set things up as above, you can use /tmp/bogo.out to retrain bogofilter for the last message processed when necessary.

      Good luck, and happy spam filtering!

      --
      Loading...
  21. Here's one I've used by wiggys · · Score: 3, Insightful
    I set up Popfile a few weeks ago at work to stop the deluge of spam one of our POP3 accounts was getting. I've never used a spam filter before (other than the usual basic keyword-based ones) and I must say that bayesian filtering is very impressive!

    I find in our case it stops 98-99% of spam dead in its tracks. There have been a few false positives, and you do need check from time to time just in case an genuine emails are misclassified, but it's surprising just how quickly the filter sorts the wheat from the chaff.

    Don't expect miracles but they can save you a lot of time... what I find cool is that it learns so quickly, almost like a complicated neural net should, but it's such a simple idea. I wonder if there are any other uses for this kind of thing?

    --

    Sorry, but my karma just ran over your dogma.

    1. Re:Here's one I've used by swillden · · Score: 2, Funny

      >I wonder if there are any other uses for this kind of thing?

      Yes, there is:

      http://groups.google.com/groups?q=venue+group:comp
      .lang.python&hl=en&lr=&ie=UTF-8&safe=off&selm=mail
      man.1048821167.17118.python-list%40python.org&rnum =1

      You mean like automatically deleting unusable links so we don't have to try to figure out how to get them to work?

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  22. Crude but effective by MrWorf · · Score: 5, Insightful

    I simply got to the point that I could count the number of real emails on my hands. So I reversed my previous filter. Instead of filtering spam to my spam folder, I made it default *ALL* mail to the spam folder except from certain known addresses (such as work, friends and my own domain). So far, it has only made one wrong decision, and that was because I hadn't written the email address of a friend correctly.

    This is waaaaay better than any other filtermethod I've tried and requires no learning period at all :)

    1. Re:Crude but effective by wiggys · · Score: 2, Funny

      You know, I think you're on to something there. I sent you an email offering you money so I can sell the idea... but I've a feeling it's been classified it as spam. Shame!

      --

      Sorry, but my karma just ran over your dogma.

  23. Re:Spam = /dev/null by mnemonic_ · · Score: 2, Insightful

    I like SpamBayes for its ability to be trained on past spam. You can point it to a folder full of past spam and it scores them all, which is much faster than gradually teaching the software to recognize spam through individual email updates.

    POPFile does not have this convenient ability (yet), though it does do general purpose sorting (i.e. not just differentiate between spam and non-spam, but stuff like work, school, linux or whatever you want). It does take a while to train though.

  24. Brief Tech Notes on Bayesian Filtering by robbyjo · · Score: 5, Informative

    Well, the type of Bayesian learning used in this spam filtering is called "Naive Bayesian" and the engine is trained using "supervised learning" technique. Naive Bayes has been proven very successful for text categorization. Spam filtering is even more successful because we essentially categorize e-mails to two labels: "spam" or "not spam".

    Supervised learning basically works like this. Feed the engine with multiple examples (in this case, e-mails) with labels (in this case, "spam" or "not spam"). The training usually takes thousands of examples to get good enough accuracy. And take note that we need both "spam" and "not spam" examples to enable the learning engine to distinguish them.

    How Naive Bayes works? Well, think of the full Bayesian Network. Bayes net is basically a causal-effect graph with annotated Conditional Probability Table (CPT) on each node denoting the probabilities of possible values. Full Bayes Net takes Directed Acyclic Graph (DAG), but Naive Bayes takes a form of tree instead due to some "naive" assumptions. (Okay, I handwaved a whole lot of details here) And in Learning Naive Bayes, we basically try to construct the tree out of the examples.

    Let P(spam) be the percentage of training e-mails that is labelled as "spam" and P(not spam) be the percentage of "not spam" e-mails.

    First, let the filter reads all e-mails and collect the words out of them. Weed out duplicates and stop words (common words like "I", "you", "the", etc). Let NumVocab be the number of words after weeding.

    Second, process e-mail one by one. Do weeding phase like the above. Let "n" be the number of words on that particular e-mail after the weeding. Scan the word one by one. Let "w" be the current word scanned and "nw" be the number of times word "w" occur in that e-mail. Imagine you have a big two dimensional array to store the result (let's call the array "P"). If the e-mail is labeled "spam", then store (nw+1)/(n+NumVocab) to P[w][spam].

    Repeat until all training e-mails are read.

    And here comes the testing phase...

    When you encounter an e-mail and want to classify whether it's spam or not, you'll need to look up the array P you created earlier. First, you do the weeding phase and scan the word one by one. The algo is like this:

    pspam = P(spam); pnospam = P(not spam);
    foreach unique words w in e-mail do
    pspam = pspam * P[w][spam];
    pnospam = pnospam * P[w][nospam];
    endfor

    if (pspam > pnospam) then return IS_SPAM; else
    return IS_NO_SPAM;

    Hope this helps.

    --

    --
    Error 500: Internal sig error
    1. Re:Brief Tech Notes on Bayesian Filtering by DuSTman31 · · Score: 2, Insightful

      Spam filtering is even more successful because we essentially categorize e-mails to two labels: "spam" or "not spam"

      True. You could simply have a spam and a not spam category. I don't think that'll necessarily lead to the highest accuracies though.

      Spam naturally seems to come in several categories - porn, penis enlargements, mortgages etc. However, it's unlikely that any one spam will simultaneously advertise porn and mortgages. Simply having a "spam" and a "not" category will not take advantage of distinctions such as that.

      When setting up systems such as popfile, consider creating subcategories for each type of spam you tend to get. More work to train, true, but likely to be more accurat once you're done.

    2. Re:Brief Tech Notes on Bayesian Filtering by Ian+Bicking · · Score: 3, Insightful
      Spam naturally seems to come in several categories - porn, penis enlargements, mortgages etc. However, it's unlikely that any one spam will simultaneously advertise porn and mortgages. Simply having a "spam" and a "not" category will not take advantage of distinctions such as that.
      Why does it matter what category? To the user they don't care what kind of spam, merely that it's spam. And this isn't just a UI issue -- the filter is not meant to indicate authoritatively what is spam and what is not. Instead it learns what the particular user considers spam. You're only going to introduce inaccuracy if you create more categories, because the user is sometimes going to miscategorize spams (e.g., porn in penis enlargement). The user is not invested in the result of that subcategorization, so it's not a good goal for training.

      Certainly there are other categorizations that are useful, e.g., work vs. private mail. Bayesian techniques can be used for further categorization, but they should only be used to categorize as far as the user cares to have their mail categorized.

      Bayesian techniques for non-spam wouldn't be that useful, anyway, because non-statistical rules generally work well for everything but spam -- it's only because spammers are specifically trying to defeat non-statistical rules that we need statistical analysis. The only other place for Bayesian techniques, IMHO, is where the user can't articulate the basis of the categorization they desire (but that's probably quite common).

    3. Re:Brief Tech Notes on Bayesian Filtering by nackrm · · Score: 2, Insightful

      Pooling spam to teach isn't such a good idea. The problem you might run into is that some people, like say a plastic surgeon, might get many emails that have words like penis, vagina, sex, larger, etc. So their filter info might allow some spam to get through. This is also the reason that mozilla's mail client wouldn't be "pretrained" for you. Instead the email probably had some key qualities to it that were dead givaways to being spam. One of those is the really long strings of characters used by spam mailers to track live email addresses. There are lots of possibilities there.

      --

      Be a man! View at -1
      acm.cs.uwec.edu
  25. Slight modification: white-list+Bayesian is useful by Jeremi · · Score: 4, Interesting
    I've found that if you add a small tweak to the Bayesian Filter, it becomes even more useful. The tweak is this: Any time you tell the Bayesian filter that an email is "non-spam", it auto-adds the From address of that email to a white-list, so that from then on any emails from that address are automatically marked as "non-spam" by the filter, no matter what they contain. (conversely, any time you mark an email as "spam", the source address of that email is removed from the white-list, if it is present)


    This allows your single spam/non-spam feedback to the system to do double duty, so that once the program knows that you consider an email source to be "trusted", it will allow even spammy-looking stuff (read: mailing list digests, plane schedules, bank statements, etc) through to your non-spam folder.


    Of course, if spammers start constructing google-style databases of who your friends are and impersonating their accounts, then this won't work anymore... but if they start that, all hell is going to break loose anyway.

    --


    I don't care if it's 90,000 hectares. That lake was not my doing.
  26. Browser ad-blocking the same way? by DrJAKing · · Score: 2, Insightful

    I wonder if a Bayesian classifier could sort out banner ads? I currently use Guidescope to block them, but it would be far better not to rely on a third party to decide what's an ad URL. It think it would work, but training it might be hard.

    (And before anyone says "Don't do that, websites will die" my response would be "Good, let most of them die." I hate ads.)

    1. Re:Browser ad-blocking the same way? by bhtooefr · · Score: 2, Informative

      Did you have Windows? If you did, it was probably WebWasher. It is free for home use. The download link is buried in the front page, so here's a direct link to the WebWasher Classic site: http://www.webwasher.com/client/home/index.html?la ng=de_EN

  27. Comment removed by account_deleted · · Score: 2, Informative

    Comment removed based on user account deletion

  28. I don't even try to filter spam out. by belroth · · Score: 2, Insightful

    Instead I filter all of my mail for wanted/expected mail into a (large) tree of input folders, mailing lists, company mailings etc.
    Most of what's left is spam, so a quick scan of the inbox (and creation of new rules) weeds out the uncaught desirables and the rest gets dropped in the bitbucket.
    The point being that legitimate mail doesn't try to spoof my filters. I haven't (yet) had any spam arriving where it shouldn't. I'd rather my ISP dumped all the crud in the bin for me, but my marginal cost is low as I'm on ADSL. I now also use a distinct email for each purpose, making it easy to spot where spammers got it from and to create new rules as needed. It's a shame I didn't do this at the start as I have a couple of early ones that are spammed but I can't dump.

    --
    I hereby inform you that I have NOT been required to provide any decryption keys.
  29. Where to get a nice Bayesian filter. by zerofoo · · Score: 2, Interesting

    I'm using this now, and it works great!

    Get it here.

    -ted

  30. naive implementation of naive Bayesian by g4dget · · Score: 3, Informative

    Graham's method is called "naive Bayesian", and it's called "naive" for a reason. It works surprisingly well, but it barely scratches the surface of what people are doing with statistical models of text.

    The lack of references on Graham's web site to prior work on text classification makes one wonder whether he just is unfamiliar with a huge body of literature going back decades or whether he just deliberately ignores them. Either way, Graham didn't invent any of the techniques and they are far from state-of-the-art. (Incidentally, you'll probably find Octave or Perl/PDL a more convenient language for implementing this stuff than Lisp.)

    Anybody seriously interested in text filtering should at least do a little bit of background reading. "Readings in Information Retrieval" by Jones and Willett covers some of the basic papers.

  31. Mozilla does this by Anonymous Coward · · Score: 3, Informative

    Mozilla incorporates a twostep filter:

    1. Is the sender in the address book? If yes, is not spam, otherwise:
    2. Does the message have a probability of 90% that it is spam based on the Bayes filter? If so, flag as spam, otherwise not spam.

  32. Human filtering by stile · · Score: 3, Funny

    Great. Wanna filter my email for me? ;)

  33. 0.0001% response rates by rippie78 · · Score: 3, Insightful

    The sheer number of spam mail sent means that even tiny response rates, reportedly 0.0001%, means junk mailers turn a profit.
    Are we missing a critical factor of the end user who actually responds to SPAM?
    If spammers survive on 0.0001% response rate, how many people are actually clicking/buying? Are these people who provide the customers for spammers going to stop or use any sort of filters?

  34. "Alanis irony" by Danny+Rathjens · · Score: 2, Funny

    That's what we refer to as "Alanis irony", 8^)

    1. Re:"Alanis irony" by joeytsai · · Score: 2, Interesting

      Actually it is ironic when you write a song called "ironic" and there are no ironies in it.

      --
      http://www.talknerdy.org
  35. My solution. by Lord+Kholdan · · Score: 3, Interesting

    I don't use email. Yes, I have a few addresses but I havent checked them in months. Email is kinda dead way of communication anyway, beaten by things such as mobile phones and instant messaging.

  36. No Junk Mail please.... by TomMajor · · Score: 3, Funny

    On my mailbox outside my apartment I have a "No Junk Mail please" sticker... This actually works. I tried to put the same sticker on my pc, but the junk mail just keeps on comming... I don't understand....

    --



    Ask me no questions, and I'll tell you no lies...
  37. The best email filter by Spud+the+Ninja · · Score: 2, Interesting

    Why go through all the work of training some software to read your email and decide if you might want to read it when most email programs have white list capabilities?

    If I don't know you, that means I don't want to talk to you. Your email goes straight a junk folder, which I can quickly scan once every few days for from names I recognize. I can add these names to my white list if I so choose.

    Granted, my job does not involve me soliciting contacts from the public at large, so this wouldn't work for everyone. I use it on my personal Hotmail account though, and I get to not even consider lots of crap every day.

    --
    You can never put too much water in a nuclear reactor.
  38. Re:who're the vikings? by mlk · · Score: 2, Informative

    Not many people know were the term "spam" comes from, but everyone[1] knows what it means (email wise), and it does come from the Monty Python sketch.

    However it did not orginally go with bulk email, but instead with some wanker on posting the same post over and over again on a newsgroup or IRC.

    [1] Including "normal" users.

    --
    Wow, I should not post when knackered.
  39. Re:Spam = /dev/null by sabaco · · Score: 2, Informative

    Don't forget SpamProbe as well. I've been using it for a couple weeks, and it has been working very well for me. I've gotten around 1400 messages, and so far 1 false positive and 6 false negatives. I don't know how well the other filters work, but that seems pretty good to me. It's sure a hell of a lot better than the DNS blacklists I use. (I'm still using those. After all, they filter out the first 70% of my incoming mail and are probably faster anyway.)

    --
    This is SO educational! -- Kintaro Oe
  40. DON'T implement it like the parent by NoOneInParticular · · Score: 3, Informative
    If you do it like the parent:
    pspam = P(spam); pnospam = P(not spam);
    foreach unique words w in e-mail do
    pspam = pspam * P[w][spam];
    pnospam = pnospam * P[w][nospam];
    endfor

    if (pspam > pnospam) then return IS_SPAM; else
    return IS_NO_SPAM;

    You'll soon be running out of bits to store the floating point results. Implement it by adding logarithms of probabilities instead of products of them, thus:

    lpspam = log(P(spam));
    lpnospam = log(P(not spam));
    foreach unique words w in e-mail do
    lpspam = lpspam + log(P[w][spam]);
    lpnospam = lpnospam + log(P[w][nospam]);
    endfor

    if (lpspam > lpnospam) then return IS_SPAM; else
    return IS_NO_SPAM;

    If you have a couple of hundred key-words, this will make a lot of difference concerning the accuracy of the predictions.