Update utils/vulnerability_classifier.py
Browse files
utils/vulnerability_classifier.py
CHANGED
@@ -37,13 +37,12 @@ def get_vulnerability_labels(preds):
|
|
37 |
|
38 |
# Get label names
|
39 |
preds_list = preds.tolist()
|
40 |
-
st.write(preds_list)
|
41 |
|
42 |
# Get the name of the group where the prediction is equal to "1"
|
43 |
result = []
|
44 |
|
45 |
-
for sublist in
|
46 |
-
result.extend([
|
47 |
|
48 |
st.write("Here are the results")
|
49 |
st.write(result)
|
|
|
37 |
|
38 |
# Get label names
|
39 |
preds_list = preds.tolist()
|
|
|
40 |
|
41 |
# Get the name of the group where the prediction is equal to "1"
|
42 |
result = []
|
43 |
|
44 |
+
for sublist in preds_list:
|
45 |
+
result.extend([label_dict[key] for key, value in enumerate(sublist) if value == 1])
|
46 |
|
47 |
st.write("Here are the results")
|
48 |
st.write(result)
|