File size: 541 Bytes
21dc881
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from fastapi import FastAPI
from classifier.Albert_latest import get_model

app = FastAPI()
model = get_model()

@app.post("/predict")
async def predict(issue: str):
    predictions = model.predict(issue)
    print(f"Predictions: {predictions}")
    id = predictions
    print(f"Predictions: {predictions}")
    return {
        "priority 1": str(predictions[0]),
        "priority 2": str(predictions[1]),
        "priority 3": str(predictions[2]),
        "priority 4": str(predictions[3]),
        "priority 5": str(predictions[4])
    }