from flask import Flask, request | |
from app import judge, judgePlus, judgeBert | |
from flask_cors import CORS | |
import threading | |
app = Flask(__name__) | |
CORS(app) | |
def hello(): | |
return {"hello":"Deploy success"} | |
def test(): | |
return "Test success" | |
def returnText(text): | |
return f'The text is {text}' | |
def check(): | |
comment = request.json['comment'] | |
result = judge(comment) | |
return result | |
def checkPlus(): | |
comment = request.json['comment'] | |
result = judgePlus(comment) | |
return result | |
def checkBert(): | |
comment = request.json['comment'] | |
result = judgeBert(comment) | |
return result | |
if __name__ == '__main__': | |
app.run(debug=False, threaded=True) |