gngpostalsrvc commited on
Commit
c8e91cc
·
verified ·
1 Parent(s): 8d5bf2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -23,7 +23,8 @@ def predict(text):
23
  text = sbl_normalization(text)
24
  word_attributions = cls_explainer(text)
25
  results = pipe(text)[0]
26
- label = f"{results['label']} ({results['score']:.2})"
 
27
  return label, word_attributions[1:-1]
28
 
29
  iface = gr.Interface(
 
23
  text = sbl_normalization(text)
24
  word_attributions = cls_explainer(text)
25
  results = pipe(text)[0]
26
+ label_keys = {'LABEL_0' : 'ABH', 'LABEL_1' : 'CBH', 'LABEL_2' : 'TBH', 'LABEL_3' : 'LBH'}
27
+ label = f"{label_keys[results['label']]} ({results['score']:.2})"
28
  return label, word_attributions[1:-1]
29
 
30
  iface = gr.Interface(