albin commited on
Commit
47c1734
·
1 Parent(s): 3628144

display string instead of int

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -49,7 +49,7 @@ class Req(BaseModel):
49
 
50
  class Resp(BaseModel):
51
  url: str
52
- label: int
53
 
54
 
55
  @app.get("/")
@@ -129,7 +129,7 @@ async def predict(request: Request, requess: Req = Depends(form_req)):
129
  prediction = model.predict(data)
130
  output = prediction[0]
131
 
132
- output_text = 1 if output == 1 else 0
133
 
134
  # Render index.html with prediction results
135
  json_compatible_resp_data = jsonable_encoder(Resp(url=requess.url, label=output_text))
 
49
 
50
  class Resp(BaseModel):
51
  url: str
52
+ label: str
53
 
54
 
55
  @app.get("/")
 
129
  prediction = model.predict(data)
130
  output = prediction[0]
131
 
132
+ output_text = "Legitimate" if output == 1 else "Phishing"
133
 
134
  # Render index.html with prediction results
135
  json_compatible_resp_data = jsonable_encoder(Resp(url=requess.url, label=output_text))