from sklearn.externals import joblib
from flask import Flask,request
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
@app.route('/predict/<sen>')
def predict(sen):
result = model.predict(sen)
return str(result)
if __name__ == '__main__':
model_path = "D://ch18//model.pkl"
model = joblib.load(model_path)
app.run(host='127.0.0.1')
机器学习 + flask 简单的模型上线
最新推荐文章于 2022-04-29 09:18:15 发布