Created
May 17, 2012 01:19
-
-
Save daspecster/2715449 to your computer and use it in GitHub Desktop.
Start of bayes_on_redis implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bayes | |
import sqlite3 | |
bor = bayes.BayesOnRedis(redis_host='localhost', redis_port=6379, redis_db=0) | |
conn = sqlite3.connect("connotation.db") | |
c = conn.cursor() | |
for row in c.execute('''SELECT * FROM source_data'''): | |
#print "Training..." + row[2] | |
#bor.train(row[2], row[1]) | |
print "Training...negative" | |
bor.train("sad", "sucks") | |
print bor.classify("sucks") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment