kokluch commited on
Commit
10286af
·
1 Parent(s): 6129880

Update score adjustment.

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -89,10 +89,10 @@ def predict(model: InputModel) -> OutputModel:
89
 
90
  if re.search(commercial_sender_pattern, sender):
91
  print("commercial sender")
92
- score = score - 0.1
93
  if re.search(commercial_stop_pattern, text):
94
  print("STOP founded")
95
- score = score - 0.2
96
  commercial_stop = True
97
  else:
98
  print("STOP missing")
@@ -127,10 +127,10 @@ def predict(model: InputModel) -> OutputModel:
127
  score = 1.0
128
  break
129
  elif overall.get('score') < 0:
130
- score = score - 0.1
131
  else:
132
  print(f"no URL found")
133
- score = score - 0.1
134
 
135
  print(f"final score {score}")
136
  action = ActionModel.NONE
 
89
 
90
  if re.search(commercial_sender_pattern, sender):
91
  print("commercial sender")
92
+ score = score * 0.9
93
  if re.search(commercial_stop_pattern, text):
94
  print("STOP founded")
95
+ score = score * 0.9
96
  commercial_stop = True
97
  else:
98
  print("STOP missing")
 
127
  score = 1.0
128
  break
129
  elif overall.get('score') < 0:
130
+ score = score * 0.9
131
  else:
132
  print(f"no URL found")
133
+ score = score * 0.9
134
 
135
  print(f"final score {score}")
136
  action = ActionModel.NONE