Skip to content

Commit

Permalink
ready for presentation, I think
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Alabi committed Nov 23, 2013
1 parent 6ddc778 commit aa8b881
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app.py
Expand Up @@ -6,6 +6,7 @@
import os
from hidden import *

from maxentclassifier import MaximumEntropyClassifier
from naivebayesclassifier import NaiveBayesClassifier

# name of training set file
Expand All @@ -16,16 +17,14 @@
nb.setThresholds(neg=1.0, pos=20.0)
nb.setWeight(0.000000000005)
nb.trainClassifier()

# ment = MaximumEntropyClassifier(fname)
# ment.ge
# classifiers = [nb, ment]
classifiers = [nb]
ment = MaximumEntropyClassifier(fname)
ment.trainClassifier()
classifiers = [nb, ment]

class MainHandler(tornado.web.RequestHandler):
def get(self):
query = self.get_argument("query", "").strip()
cchosen = int(self.get_argument("classifier", 0))
cchosen = int(self.get_argument("classifier-type", 0))

auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
Expand Down
6 changes: 6 additions & 0 deletions static/js/main.js
Expand Up @@ -56,4 +56,10 @@ $( document ).ready(function() {

$("#visuals").show();
}

if (document.URL.indexOf("classifier-type=1") != -1) {
$("option[value='1']").attr("selected", "selected");
} else {
$("option[value='0']").attr("selected", "selected");
}
});

0 comments on commit aa8b881

Please sign in to comment.