Spaces:
Runtime error
Runtime error
frostymelonade
commited on
Commit
Β·
e859a81
1
Parent(s):
9de1f50
added text box for the probabilities as output
Browse files
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()
|