Pavankalyan commited on
Commit
2e1bfaf
1 Parent(s): 8f4c005

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @app.route("/predict", methods=["POST"])
2
+ @expects_json(SCHEMA)
3
+ def predict():
4
+ request_obj = g.data
5
+ text = request_obj["text"]
6
+ candidate_labels = request_obj["candidate_labels"]
7
+ # predict
8
+ prediction = ZeroShotTextClassifier.predict(
9
+ text=text,
10
+ candidate_labels=candidate_labels)
11
+ return jsonify(prediction)