mawairon commited on
Commit
db842cf
1 Parent(s): f9ca570

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -15,6 +15,15 @@ from huggingface_hub import hf_hub_download, login
15
  label_to_int = pd.read_pickle('label_to_int.pkl')
16
  int_to_label = {v: k for k, v in label_to_int.items()}
17
 
 
 
 
 
 
 
 
 
 
18
  class LogisticRegressionTorch(nn.Module):
19
  def __init__(self, input_dim: int, output_dim: int):
20
  super(LogisticRegressionTorch, self).__init__()
 
15
  label_to_int = pd.read_pickle('label_to_int.pkl')
16
  int_to_label = {v: k for k, v in label_to_int.items()}
17
 
18
+ # Update labels based on the given conditions
19
+ for k, v in int_to_label.items():
20
+ if "KOREA" in v:
21
+ int_to_label[k] = "KOREA"
22
+ elif "KINGDOM" in v:
23
+ int_to_label[k] = "UK"
24
+ elif "RUSSIAN" in v:
25
+ int_to_label[k] = "RUSSIA"
26
+
27
  class LogisticRegressionTorch(nn.Module):
28
  def __init__(self, input_dim: int, output_dim: int):
29
  super(LogisticRegressionTorch, self).__init__()