futranbg commited on
Commit
d792e08
Β·
1 Parent(s): d5f2c23

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -9,6 +9,7 @@ def classify(input):
9
  labels,values = model.predict(input, k=5)
10
  paired = zip(labels, values)
11
  label_dict = dict(paired)
 
12
  return label_dict
13
 
14
  iface = gr.Interface(fn=classify, inputs="text", outputs="label")
 
9
  labels,values = model.predict(input, k=5)
10
  paired = zip(labels, values)
11
  label_dict = dict(paired)
12
+ label_dict = {k.removeprefix('__label__'): v for k, v in label_dict.items()}
13
  return label_dict
14
 
15
  iface = gr.Interface(fn=classify, inputs="text", outputs="label")