sdafd commited on
Commit
34aed82
1 Parent(s): a6a844b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -5,14 +5,14 @@ def analyze_output(input_text):
5
  pipe = pipeline("text-classification", model="Titeiiko/OTIS-Official-Spam-Model")
6
  result = pipe(input_text)[0]
7
  if result["label"] == "LABEL_0":
8
- return {"type": "Not Spam", "probability": result["score"]}
9
  else:
10
- return {"type": "Spam", "probability": result["score"]}
11
 
12
  iface = gr.Interface(
13
  fn=analyze_output,
14
  inputs=gr.Textbox(),
15
- outputs=["text", "text"],
16
  live=False,
17
  title="Spam Classification App",
18
  description="Enter a text to classify it as Spam or Not Spam.",
 
5
  pipe = pipeline("text-classification", model="Titeiiko/OTIS-Official-Spam-Model")
6
  result = pipe(input_text)[0]
7
  if result["label"] == "LABEL_0":
8
+ return f"Not Spam: {result['score']:.4f}"
9
  else:
10
+ return f"Spam: {result['score']:.4f}"
11
 
12
  iface = gr.Interface(
13
  fn=analyze_output,
14
  inputs=gr.Textbox(),
15
+ outputs="text",
16
  live=False,
17
  title="Spam Classification App",
18
  description="Enter a text to classify it as Spam or Not Spam.",