hackerbyhobby commited on
Commit
88a5e15
·
unverified ·
1 Parent(s): d699ee1

updated scam weights

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -34,12 +34,12 @@ def keyword_and_url_boost(probabilities, text):
34
  found_urls = re.findall(r"(https?://[^\s]+)", lower_text)
35
  url_boost = 0.0
36
  if found_urls:
37
- # For demonstration: a flat +10% if a URL is found
38
- url_boost = 0.20
39
 
40
  # 3. Combine total boost
41
  total_boost = keyword_boost + url_boost
42
- total_boost = min(total_boost, 0.60) # cap at +40%
43
 
44
  if total_boost <= 0:
45
  return probabilities # no change if no keywords/URLs found
@@ -50,8 +50,8 @@ def keyword_and_url_boost(probabilities, text):
50
 
51
  # 4. Distribute the total boost equally to "SMiShing" and "Other Scam"
52
  half_boost = total_boost / 2.0
53
- smishing_boosted = smishing_prob + half_boost
54
- other_scam_boosted = other_scam_prob + half_boost
55
  legit_boosted = legit_prob
56
 
57
  # 5. Re-normalize so they sum to 1
 
34
  found_urls = re.findall(r"(https?://[^\s]+)", lower_text)
35
  url_boost = 0.0
36
  if found_urls:
37
+ # For demonstration: a flat +30% if a URL is found
38
+ url_boost = 0.30
39
 
40
  # 3. Combine total boost
41
  total_boost = keyword_boost + url_boost
42
+ total_boost = min(total_boost, 0.80) # cap at +80%
43
 
44
  if total_boost <= 0:
45
  return probabilities # no change if no keywords/URLs found
 
50
 
51
  # 4. Distribute the total boost equally to "SMiShing" and "Other Scam"
52
  half_boost = total_boost / 2.0
53
+ smishing_boosted = smishing_prob + url_boost
54
+ other_scam_boosted = other_scam_prob + keyword_boost
55
  legit_boosted = legit_prob
56
 
57
  # 5. Re-normalize so they sum to 1