Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,8 +19,10 @@ def classify_text(text):
|
|
19 |
for result in results for item in result
|
20 |
]
|
21 |
output = {}
|
22 |
-
|
23 |
-
|
|
|
|
|
24 |
return output
|
25 |
|
26 |
demo = gr.Interface(fn=classify_text, inputs=[gr.Textbox(label="Input")], outputs=gr.Label(label="Classification"), title="Text Classification")
|
|
|
19 |
for result in results for item in result
|
20 |
]
|
21 |
output = {}
|
22 |
+
formatted_results = formatted_results[0]
|
23 |
+
print(formatted_results)
|
24 |
+
for i in range(len(formatted_results)):
|
25 |
+
output[formatted_results[i]['label']] = formatted_results[i]['score']
|
26 |
return output
|
27 |
|
28 |
demo = gr.Interface(fn=classify_text, inputs=[gr.Textbox(label="Input")], outputs=gr.Label(label="Classification"), title="Text Classification")
|