Keras模型部署到烧瓶文本预测中,但无法预测对我有帮助

问题描述 投票:0回答:1

@ app.route('/ article //')def article(id):#创建光标mycursor = mydb.cursor(dictionary = True)

# Get article
result = mycursor.execute("SELECT label FROM articles WHERE id = %s", [id])

article = mycursor.fetchone()

features = prepData(article)

prediction = int((np.asscalar(load_model.predict(features)))*100)
return render_template('article.html', article=article, prediction=prediction)
flask keras model predict
1个回答
0
投票

{{%extended'layout.html'%}] >>

{{%block body%}

<h1>{{article.title}}</h1>
<small>Written by {{article.author}} on {{article.create_date}}</small>
<hr>
<div>
    {{article.body }}
</div>


<h1>Predicted:</h1>
{{ prediction }}

{{%endblock%}

© www.soinside.com 2019 - 2024. All rights reserved.