minimalFlaskAPI / app.py
filipeclduarte's picture
Update app.py
790c0dc
raw
history blame contribute delete
445 Bytes
from flask import Flask, request
from inference import predict, predict_general
app = Flask(__name__)
@app.route("/")
def index():
return {"output": "Hello, world!"}
@app.route("/predict/<text>")
def predict_sentiment(text):
return predict(text)[0]
@app.route("/predictSentimentGeneral/<text>")
def predict_sentiment_general(text):
return predict_general(text)[0]
if __name__ == "__main__":
app.run(host="0.0.0.0", port=7860)