def inline_predict(docket_number): info = scdb.get_case_info(docket_number) result = predict_case(docket_number) resultint = int(round(result)) if resultint > 1: resultint = 1 if resultint == 1: winner = "Petitioner" else: winner = "Respondent" if info["partyWinning"] == "1": actual = "Petitioner" elif info["partyWinning"] == "0": actual = "Respondent" else: actual = "Unclear" correct = False if winner == actual: correct = True confidence_level = int(abs(result - 0.5)*100) if confidence_level < 40: low_confidence = True return render_template('inline_predict.html', **locals())
def json_predict(docket_number): return str(predict_case(docket_number))