frostymelonade commited on
Commit
e859a81
Β·
1 Parent(s): 9de1f50

added text box for the probabilities as output

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -20,6 +20,6 @@ def classify_pun(text):
20
  inputs = [tokenizer(text, truncation=True)]
21
  predictions = trainer.predict(inputs)
22
  label = "Pun" if predictions[0][0][0] < predictions[0][0][1] else "Not a pun"
23
- return label
24
 
25
- gr.Interface(fn=classify_pun, inputs=["text"], outputs=["text"]).launch()
 
20
  inputs = [tokenizer(text, truncation=True)]
21
  predictions = trainer.predict(inputs)
22
  label = "Pun" if predictions[0][0][0] < predictions[0][0][1] else "Not a pun"
23
+ return label, str(predictions[0][0])
24
 
25
+ gr.Interface(fn=classify_pun, inputs=["text"], outputs=["text", "text"]).launch()