Spaces:
Runtime error
Runtime error
Commit
·
236f4b8
1
Parent(s):
a04f34c
Update app.py
Browse files
app.py
CHANGED
@@ -21,9 +21,9 @@ def predict(text):
|
|
21 |
feelings = [(i, j) for i, j in zipped_list if i.startswith('feeling')]
|
22 |
harm = [(i, j) for i, j in zipped_list if i.startswith('harm')]
|
23 |
# keep tops for each one
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
# top is the combo of these
|
28 |
top = issues + feelings + harm
|
29 |
d = {i: j for i, j in top}
|
|
|
21 |
feelings = [(i, j) for i, j in zipped_list if i.startswith('feeling')]
|
22 |
harm = [(i, j) for i, j in zipped_list if i.startswith('harm')]
|
23 |
# keep tops for each one
|
24 |
+
issues = sorted(issues, key=lambda x: x[1])[::-1][:3]
|
25 |
+
feelings = sorted(feelings, key=lambda x: x[1])[::-1][:3]
|
26 |
+
harm = sorted(harm, key=lambda x: x[1])[::-1][:1]
|
27 |
# top is the combo of these
|
28 |
top = issues + feelings + harm
|
29 |
d = {i: j for i, j in top}
|