Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
| 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(
|