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)
def index(): menu = get_menu() return redirect(menu[0]["url"])
def templates_panel(): config = load_config(STORE) return render_template("templates.html", menu=get_menu(), c=config)
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)
def whitelist_panel(): config = load_config(STORE) return render_template("whitelist.html", menu=get_menu(), c=config)
def visa_panel(): return render_template("visa.html", menu=get_menu())
def quill_panel(): config = load_config(STORE) return render_template("quill.html", menu=get_menu(), c=config)