Spaces:
Runtime error
Runtime error
Commit
·
cfc3e8a
1
Parent(s):
17c1e7f
Update app.py
Browse files
app.py
CHANGED
@@ -23,12 +23,14 @@ def predict(text):
|
|
23 |
issues = [(i, j) for i, j in zipped_list if i.startswith('issue')]
|
24 |
feelings = [(i, j) for i, j in zipped_list if i.startswith('feeling')]
|
25 |
harm = [(i, j) for i, j in zipped_list if i.startswith('harm')]
|
|
|
26 |
# keep tops for each one
|
27 |
issues = sorted(issues, key=lambda x: x[1])[::-1][:3]
|
28 |
feelings = sorted(feelings, key=lambda x: x[1])[::-1][:3]
|
29 |
harm = sorted(harm, key=lambda x: x[1])[::-1][:1]
|
|
|
30 |
# top is the combo of these
|
31 |
-
top = issues + feelings + harm
|
32 |
|
33 |
logToNotion(text, top)
|
34 |
|
|
|
23 |
issues = [(i, j) for i, j in zipped_list if i.startswith('issue')]
|
24 |
feelings = [(i, j) for i, j in zipped_list if i.startswith('feeling')]
|
25 |
harm = [(i, j) for i, j in zipped_list if i.startswith('harm')]
|
26 |
+
sentiment = [(i, j) for i, j in zipped_list if i.startswith('sentiment')]
|
27 |
# keep tops for each one
|
28 |
issues = sorted(issues, key=lambda x: x[1])[::-1][:3]
|
29 |
feelings = sorted(feelings, key=lambda x: x[1])[::-1][:3]
|
30 |
harm = sorted(harm, key=lambda x: x[1])[::-1][:1]
|
31 |
+
sentiment = sorted(sentiment, key=lambda x: x[1])[::-1][:1]
|
32 |
# top is the combo of these
|
33 |
+
top = issues + feelings + harm + sentiment
|
34 |
|
35 |
logToNotion(text, top)
|
36 |
|