'mint autosave'
Browse files
app.py
CHANGED
|
@@ -19,10 +19,9 @@ labels = {'LABEL_0': 'toxic', 'LABEL_1': 'severe_toxic', 'LABEL_2': 'obscene', '
|
|
| 19 |
# make a dictionary of the labels and values
|
| 20 |
def unpack(result):
|
| 21 |
output = {}
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
output[labels[res['label']]] = res['score']
|
| 26 |
return output
|
| 27 |
|
| 28 |
def add_to_table(input, result, output):
|
|
|
|
| 19 |
# make a dictionary of the labels and values
|
| 20 |
def unpack(result):
|
| 21 |
output = {}
|
| 22 |
+
if type(result) is list:
|
| 23 |
+
for res in result:
|
| 24 |
+
output[labels[res['label']]] = res['score']
|
|
|
|
| 25 |
return output
|
| 26 |
|
| 27 |
def add_to_table(input, result, output):
|