red

redisbayes

Naïve Bayesian Text Classifier on Redis

Showing:

Popularity

Downloads/wk

0

GitHub Stars

101

Maintenance

Last Commit

6yrs ago

Contributors

4

Package

Dependencies

0

License

MIT

Categories

Readme

redisbayes Build Status

What Is This?

It's a Naïve Bayesian Text Classifier on Redis (aka spam filter.) I wrote this to filter spammy comments from a high traffic forum website and it worked pretty well. It can work for you too :) It's not tied to any particular format like email, it just deals with the raw text.

This is probably the only spam filtering library you'll find for Python that's simple (170 lines of code), works (30 lines of test code), and doesn't suck.

Installation

From folder:

sudo python setup.py install

From cheeseshop:

sudo pip install redisbayes

From git:

sudo pip install git+git://github.com/jart/redisbayes.git

Basic Usage

import redis, redisbayes
rb = redisbayes.RedisBayes(redis=redis.Redis())

rb.train('good', 'sunshine God love sex lobster sloth')
rb.train('bad', 'fear death horror government zombie')

assert rb.classify('sloths are so cute i love them') == 'good'
assert rb.classify('i am a zombie and love the government') == 'bad'

print rb.score('i fear God and hate the government')

rb.untrain('good', 'sunshine God love sex lobster sloth')
rb.untrain('bad', 'fear death horror government zombie')

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial