コード例 #1
0
ファイル: main.py プロジェクト: gachecha/WBIS-Project-2II36
def search_spammer():
    # here to detect if the new review is a spam
    #return request.form["title"]
    min_score = 1
    dup_no = dup.dup(min_score, request.args.get["text"])
    # userid = "ALYU98KL3VUGF"/A1GLC0S9H532IU
    min_post = 1
    early_constraint = 3600*24*180 # (sec*min)*hours*days*months
    detection_dict = dev.spammer_detect(request.args.get["userid"], min_post, early_constraint)
    #return str(devnrep_dict["time_diff"])
    detection_dict["dup_no"] = dup_no
    detection_dict["metric"] = dev.metrics(detection_dict) 
    #print detection_dict
    return render_template("result.html", result = detection_dict)
コード例 #2
0
ファイル: mrtest.py プロジェクト: gachecha/WBIS-Project-2II36
 def reducer(self, key, values):
     result = dev.spammer_detect(key, 3, 3600*24*180)
     result["_id"] = key
     users.insert(result)
     yield key, result