Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,21 +19,55 @@ model.load_state_dict(torch.load(model_path, map_location="cpu"))
|
|
19 |
model.eval()
|
20 |
|
21 |
# Label mapping
|
22 |
-
sentiment_map = {0: "
|
23 |
|
24 |
event_map = {
|
25 |
-
0: "
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
|
|
|
37 |
idx_labels = [
|
38 |
"idx_energy", "idx_basic", "idx_indust", "idx_noncyc", "idx_cyclic",
|
39 |
"idx_health", "idx_finance", "idx_propert", "idx_techno", "idx_infra", "idx_trans"
|
|
|
19 |
model.eval()
|
20 |
|
21 |
# Label mapping
|
22 |
+
sentiment_map = {0: "Negative", 1: "Netral", 2: "Positive"}
|
23 |
|
24 |
event_map = {
|
25 |
+
0: "IPO",
|
26 |
+
1: "banking",
|
27 |
+
2: "banking sector",
|
28 |
+
3: "commodity",
|
29 |
+
4: "commodity + stock recommendation",
|
30 |
+
5: "company scandal",
|
31 |
+
6: "corporate action",
|
32 |
+
7: "corporate appointment",
|
33 |
+
8: "corporate expansion",
|
34 |
+
9: "corporate finance",
|
35 |
+
10: "corporate outlook",
|
36 |
+
11: "corporate outlook + stock recommendation",
|
37 |
+
12: "corporate performance",
|
38 |
+
13: "corporate rebranding",
|
39 |
+
14: "corporate strategy",
|
40 |
+
15: "crypto",
|
41 |
+
16: "currency",
|
42 |
+
17: "delisting",
|
43 |
+
18: "foreign activity",
|
44 |
+
19: "global market",
|
45 |
+
20: "government policy",
|
46 |
+
21: "insider activity",
|
47 |
+
22: "interest rate",
|
48 |
+
23: "investment product",
|
49 |
+
24: "investment strategy",
|
50 |
+
25: "ipo",
|
51 |
+
26: "logistics expansion",
|
52 |
+
27: "macro economy",
|
53 |
+
28: "macroeconomy",
|
54 |
+
29: "market index",
|
55 |
+
30: "market index + foreign activity",
|
56 |
+
31: "market index + stock recommendation",
|
57 |
+
32: "market outlook",
|
58 |
+
33: "market outlook + stock recommendation",
|
59 |
+
34: "merger & acquisition",
|
60 |
+
35: "politics",
|
61 |
+
36: "private placement",
|
62 |
+
37: "property",
|
63 |
+
38: "regulation",
|
64 |
+
39: "sector outlook",
|
65 |
+
40: "sector rotation",
|
66 |
+
41: "stock recommendation",
|
67 |
+
42: "trading activity"
|
68 |
}
|
69 |
|
70 |
+
|
71 |
idx_labels = [
|
72 |
"idx_energy", "idx_basic", "idx_indust", "idx_noncyc", "idx_cyclic",
|
73 |
"idx_health", "idx_finance", "idx_propert", "idx_techno", "idx_infra", "idx_trans"
|