BayeSynOnReISIS库提供了类似于许多垃圾邮件/ HAMM过滤技术的给定文本上的贝叶斯分类。
bayes_on_redis的Python项目详细描述
#什么是Bayesonredis?
redis上的贝叶斯分类器
##为什么在Redis上?
[redis](http://code.google.com/p/redis)是一个持久的内存数据库,支持各种数据结构,如列表、集合和有序集合。 所有这些数据类型都可以通过原子操作来操作,如推/弹出元素、添加/删除元素、执行服务器端联合、交集、集合之间的差异等等。
因为redis属性:
- 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.
##如何安装?(红宝石版)
gem install bayes_on_redis
##入门
# 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.”)
##对于pythonistas
bayesonredis在python中也可用。使用相同的api。
##贡献
[分叉http://github.com/didip/bayes_on_redis](http://github.com/didip/bayes_on_redis)并发送拉取请求。