Skip to main content

bayes_on_redis library provides bayesian classification on a given text similar to many SPAM/HAM filtering technique.

Project description

# What is BayesOnRedis?

Bayesian classifier on top of Redis

## Why on Redis?

[Redis](http://code.google.com/p/redis) is a persistent in-memory database with supports for various data structures such as lists, sets, and ordered sets. All this data types can be manipulated with atomic operations to push/pop elements, add/remove elements, perform server side union, intersection, difference between sets, and so forth.

Because of Redis properties:

  • It is extremely easy to implement simple algorithm such as bayesian filter.

  • The persistence of Redis means that the Bayesian implementation can be used in real production environment.

  • Even though I don’t particularly care about performance at the moment. Redis benchmarks give me confidence that the implementation can scale to relatively large training data.

## How to install? (Ruby version)

gem install bayes_on_redis

## Getting started

# Create instance of BayesOnRedis and pass your Redis information. # Of course, use real sentences for much better accuracy. # Unless if you want to train spam related things. bor = BayesOnRedis.new(:redis_host => ‘127.0.0.1’, :redis_port => 6379, :redis_db => 5)

# Teach it bor.train “good”, “sweet awesome kick-ass cool pretty smart” bor.train “bad”, “sucks lame boo death bankrupt loser sad”

# Then ask it to classify text. bor.classify(“awesome kick-ass ninja can still be lame.”)

## for Pythonistas

BayesOnRedis is also available in Python. With the same API.

## Contributing

[Fork http://github.com/didip/bayes_on_redis](http://github.com/didip/bayes_on_redis) and send pull requests.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

bayes_on_redis-0.1.9-py2.6.egg (7.8 kB view details)

Uploaded Source

File details

Details for the file bayes_on_redis-0.1.9-py2.6.egg.

File metadata

File hashes

Hashes for bayes_on_redis-0.1.9-py2.6.egg
Algorithm Hash digest
SHA256 a344b8dd8ff77a33a2a80a9a7a2b17ca2fd885ac7df5644ed4e37ce577aec13d
MD5 7cf97f53a278f47e60edd1bedff185ac
BLAKE2b-256 115f8559016559cfc551a9816001255bee54131ceeed3cc95f698bb31309ace5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page