File size: 399 Bytes
e9dc5bd
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
from fastapi import Depends, FastAPI
from .classifier.model import Model, get_model

app = FastAPI()


@app.post("/predict")
async def predict(issue: str, model: Model = Depends(get_model)):
    accessibility_confidence, nonaccessibility_confidence = model.predict(issue)
    return {"Accessibility": str(accessibility_confidence),
            "Non-accessibility": str(nonaccessibility_confidence)}