Example #1
0
def smart_reply_panel():
    prediction = None

    if request.method == 'POST':
        if 'text' in request.form:
            text = request.form['text']
            p = model.predict_proba([text])[0]

            confidence = np.max(p)
            class_ = model.classes_[np.argmax(p)]

            prediction = (confidence, class_)

    return render_template("smart_reply.html",
                           c=load_config(STORE),
                           menu=get_menu(),
                           prediction=prediction)
Example #2
0
def index():
    menu = get_menu()
    return redirect(menu[0]["url"])
Example #3
0
def templates_panel():
    config = load_config(STORE)
    return render_template("templates.html", menu=get_menu(), c=config)
Example #4
0
def stats_panel():
    with Store(STORE) as s:
        times = s["num_emails"]
        hours = int(round((times * 5) / 60.0))

    return render_template("stats.html", menu=get_menu(), times=times, hours=hours)
Example #5
0
def whitelist_panel():
    config = load_config(STORE)
    return render_template("whitelist.html", menu=get_menu(), c=config)
Example #6
0
 def visa_panel():
     return render_template("visa.html", menu=get_menu())
Example #7
0
def quill_panel():
    config = load_config(STORE)
    return render_template("quill.html", menu=get_menu(), c=config)