Can you write rules that catch spam?

Two ways to build a filter: write the rules yourself, or let the computer learn them from labeled examples.

A spam email counts as caught if it contains any of your keywords. Add or remove keywords and watch the inbox.

Your rules

Try adding “fr33”. Then look at “W1NNER” and “free tea”. Every fix opens a new hole.

Now we write no rules. We give the computer 30 emails that people already labeled, and it counts which words show up in spam and which in normal mail.

What it learned

Training emails

    Type any message. Each word is colored by what the model learned about it.

    points to spam points to not spam never seen in training
    Model:

    A toy model (Naive Bayes, the classic early spam filter) trained on 30 short emails and checked on 8. Real filters learn from far larger collections and use many more clues, and 8 test emails are far too few to judge any filter. The point here is the idea, not the score.