Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,10 +26,12 @@ def classify(input_text):
|
|
| 26 |
label_list = [class_dict[int(idx)] for idx in idx_list]
|
| 27 |
score_list = [output[0][i]['score'] for i in range(len(output[0]))]
|
| 28 |
return dict(zip(label_list, score_list))
|
|
|
|
| 29 |
label = gr.Label()
|
| 30 |
iface = gr.Interface(fn = classify,
|
| 31 |
inputs = "text",
|
| 32 |
outputs = label,
|
| 33 |
-
title = 'chinese news classification'
|
|
|
|
| 34 |
|
| 35 |
iface.launch(inline = False)
|
|
|
|
| 26 |
label_list = [class_dict[int(idx)] for idx in idx_list]
|
| 27 |
score_list = [output[0][i]['score'] for i in range(len(output[0]))]
|
| 28 |
return dict(zip(label_list, score_list))
|
| 29 |
+
examples = ["习近平驾崩", "李易峰出狱"]
|
| 30 |
label = gr.Label()
|
| 31 |
iface = gr.Interface(fn = classify,
|
| 32 |
inputs = "text",
|
| 33 |
outputs = label,
|
| 34 |
+
title = 'chinese news classification',
|
| 35 |
+
examples = examples)
|
| 36 |
|
| 37 |
iface.launch(inline = False)
|