IntentFinal / app.py
Pavankalyan's picture
Create app.py
2e1bfaf
raw
history blame
323 Bytes
@app.route("/predict", methods=["POST"])
@expects_json(SCHEMA)
def predict():
request_obj = g.data
text = request_obj["text"]
candidate_labels = request_obj["candidate_labels"]
# predict
prediction = ZeroShotTextClassifier.predict(
text=text,
candidate_labels=candidate_labels)
return jsonify(prediction)