plipustel commited on
Commit
b74cb14
·
verified ·
1 Parent(s): b314282

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +45 -11
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: "Negatif", 1: "Positif", 2: "Netral"}
23
 
24
  event_map = {
25
- 0: "corporate action", 1: "divestment", 2: "ipo", 3: "regulation", 4: "insider",
26
- 5: "market outlook", 6: "forex", 7: "commodity", 8: "finance report", 9: "debt",
27
- 10: "macroeconomic", 11: "acquisition", 12: "merger", 13: "product launch",
28
- 14: "litigation", 15: "rating", 16: "investment", 17: "employment", 18: "governance",
29
- 19: "funding", 20: "competition", 21: "environment", 22: "infrastructure",
30
- 23: "trade", 24: "tax", 25: "technology", 26: "sector update", 27: "bankruptcy",
31
- 28: "security", 29: "restructuring", 30: "sustainability", 31: "ownership",
32
- 32: "inflation", 33: "interest rate", 34: "monetary policy", 35: "digital economy",
33
- 36: "consumer behavior", 37: "political", 38: "climate", 39: "energy",
34
- 40: "supply chain", 41: "geopolitical", 42: "misc"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"