Spaces:
Running
Running
Tirath5504
commited on
Commit
•
abb6d70
1
Parent(s):
07459be
Update app.py
Browse files
app.py
CHANGED
@@ -12,13 +12,10 @@ def classify_text(text):
|
|
12 |
result = classifier(text)
|
13 |
return result[0]['label'], result[0]['score']
|
14 |
|
15 |
-
with gr.
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
text_input.change(fn=classify_text, inputs=text_input, outputs=[label_output, score_output])
|
23 |
-
|
24 |
-
demo.launch()
|
|
|
12 |
result = classifier(text)
|
13 |
return result[0]['label'], result[0]['score']
|
14 |
|
15 |
+
with gr.Interface(
|
16 |
+
fn=classify_text,
|
17 |
+
inputs=[gr.Textbox(label="Input Text"), gr.Button("Classify")],
|
18 |
+
outputs=[gr.Textbox(label="Predicted Label"), gr.Number(label="Prediction Score")],
|
19 |
+
live=False
|
20 |
+
) as demo:
|
21 |
+
demo.launch()
|
|
|
|
|
|