hackerbyhobby commited on
Commit
d699ee1
·
unverified ·
1 Parent(s): 391e98a

updated scam weights

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -27,7 +27,7 @@ def keyword_and_url_boost(probabilities, text):
27
 
28
  # 1. Check scam keywords
29
  keyword_count = sum(1 for kw in SCAM_KEYWORDS if kw in lower_text)
30
- keyword_boost = 0.05 * keyword_count # 5% per found keyword
31
  keyword_boost = min(keyword_boost, 0.30) # cap at +30%
32
 
33
  # 2. Check if there's any URL (simple regex for http/https)
@@ -35,11 +35,11 @@ def keyword_and_url_boost(probabilities, 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.10
39
 
40
  # 3. Combine total boost
41
  total_boost = keyword_boost + url_boost
42
- total_boost = min(total_boost, 0.40) # cap at +40%
43
 
44
  if total_boost <= 0:
45
  return probabilities # no change if no keywords/URLs found
 
27
 
28
  # 1. Check scam keywords
29
  keyword_count = sum(1 for kw in SCAM_KEYWORDS if kw in lower_text)
30
+ keyword_boost = 0.50 * keyword_count # 5% per found keyword
31
  keyword_boost = min(keyword_boost, 0.30) # cap at +30%
32
 
33
  # 2. Check if there's any URL (simple regex for http/https)
 
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