Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 43 lines (25 sloc) 1.629 kb
7738bed Updated README
Didip Kerabat authored
1 # What is BayesOnRedis?
78a0389 first commit
Didip Kerabat authored
2
3 Bayesian classifier on top of Redis
4
5 ## Why on Redis?
6
74d2f5a Updated README
Didip Kerabat authored
7 [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.
8 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.
9
10 Because of Redis properties:
11
12 * It is extremely easy to implement simple algorithm such as bayesian filter.
13
14 * The persistence of Redis means that the Bayesian implementation can be used in real production environment.
15
16 * 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.
7738bed Updated README
Didip Kerabat authored
17
18 ## How to install?
19
20 gem install bayes_on_redis
78a0389 first commit
Didip Kerabat authored
21
22 ## Getting started
23
1a99398 More explanation on README
Didip Kerabat authored
24 # Create instance of BayesOnRedis and pass your Redis information.
8f57e94 updated TODO
Didip Kerabat authored
25 # Of course, use real sentences for much better accuracy.
26 # Unless if you want to train spam related things.
1a99398 More explanation on README
Didip Kerabat authored
27 bor = BayesOnRedis.new(:redis_host => '127.0.0.1', :redis_port => 6379, :redis_db => 5)
28
29 # Teach it
30 bor.train "good", "sweet awesome kick-ass cool pretty smart"
31 bor.train "bad", "sucks lame boo death bankrupt loser sad"
32
33 # Then ask it to classify text.
7738bed Updated README
Didip Kerabat authored
34 bor.classify("awesome kick-ass ninja can still be lame.")
1a99398 More explanation on README
Didip Kerabat authored
35
74d2f5a Updated README
Didip Kerabat authored
36 ## for Pythonistas
37
38 BayesOnRedis is also available in Python. With the same API.
39
78a0389 first commit
Didip Kerabat authored
40 ## Contributing
41
7738bed Updated README
Didip Kerabat authored
42 [Fork http://github.com/didip/bayes_on_redis](http://github.com/didip/bayes_on_redis) and send pull requests.
Something went wrong with that request. Please try again.