Update app.py
Browse files
app.py
CHANGED
@@ -15,13 +15,22 @@ def classify_text(text):
|
|
15 |
pred,pred_idx,probs = learn.predict(text)
|
16 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
-
interface = gr.Interface(fn=classify_text,
|
20 |
-
inputs=gr.inputs.Texbox(placeholder="Enter Text here", label='Input text',lines=5)),
|
21 |
-
outputs=gr.outputs.Label(num_top_classes=4, label='Emotion in the Text'),
|
22 |
-
verbose=True,
|
23 |
-
title="Emotion Classifier",
|
24 |
-
theme='soft')
|
25 |
interface.launch()
|
26 |
|
27 |
|
|
|
15 |
pred,pred_idx,probs = learn.predict(text)
|
16 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
17 |
|
18 |
+
interface = gr.Interface(
|
19 |
+
fn=classify_text,
|
20 |
+
inputs=gr.inputs.Textbox(
|
21 |
+
placeholder="Enter Text here",
|
22 |
+
label='Input text',
|
23 |
+
lines=5
|
24 |
+
),
|
25 |
+
outputs=gr.outputs.Label(
|
26 |
+
num_top_classes=4,
|
27 |
+
label='Emotion in the Text'
|
28 |
+
),
|
29 |
+
verbose=True,
|
30 |
+
title="Emotion Classifier",
|
31 |
+
theme='soft'
|
32 |
+
)
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
interface.launch()
|
35 |
|
36 |
|