bayes_on_redis 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +22 -3
- metadata +6 -6
data/README.markdown
CHANGED
@@ -4,16 +4,27 @@ Bayesian classifier on top of Redis
|
|
4
4
|
|
5
5
|
## Why on Redis?
|
6
6
|
|
7
|
-
|
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.
|
8
9
|
|
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.
|
17
|
+
|
18
|
+
## How to install? (Ruby version)
|
10
19
|
|
11
20
|
gem install bayes_on_redis
|
12
21
|
|
13
22
|
## Getting started
|
14
23
|
|
15
24
|
# Create instance of BayesOnRedis and pass your Redis information.
|
16
|
-
|
25
|
+
# Of course, use real sentences for much better accuracy.
|
26
|
+
# Unless if you want to train spam related things.
|
27
|
+
bor = BayesOnRedis.new(:redis_host => '127.0.0.1', :redis_port => 6379, :redis_db => 0)
|
17
28
|
|
18
29
|
# Teach it
|
19
30
|
bor.train "good", "sweet awesome kick-ass cool pretty smart"
|
@@ -22,6 +33,14 @@ Because of its persistent but also in-memory data structures, Redis is perfect f
|
|
22
33
|
# Then ask it to classify text.
|
23
34
|
bor.classify("awesome kick-ass ninja can still be lame.")
|
24
35
|
|
36
|
+
## for Pythonistas
|
37
|
+
|
38
|
+
BayesOnRedis is also available in Python. With the same API.
|
39
|
+
|
40
|
+
easy_install bayes_on_redis
|
41
|
+
|
42
|
+
|
43
|
+
|
25
44
|
## Contributing
|
26
45
|
|
27
46
|
[Fork http://github.com/didip/bayes_on_redis](http://github.com/didip/bayes_on_redis) and send pull requests.
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bayes_on_redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 19
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Didip Kerabat
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-07-08 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
61
|
requirements: []
|
62
62
|
|
63
63
|
rubyforge_project:
|
64
|
-
rubygems_version: 1.
|
64
|
+
rubygems_version: 1.6.2
|
65
65
|
signing_key:
|
66
66
|
specification_version: 3
|
67
67
|
summary: Bayesian filter on top of Redis
|