hackerbyhobby commited on
Commit
dfb950c
·
unverified ·
1 Parent(s): f2b9e79

updated regex for URLs

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -60,7 +60,7 @@ def boost_probabilities(probabilities: dict, text: str):
60
  smishing_boost = 0.30 * smishing_count
61
  other_scam_boost = 0.30 * other_scam_count
62
 
63
- found_urls = re.findall(r"(https?://[^\s]+)", lower_text)
64
  if found_urls:
65
  smishing_boost += 0.35
66
 
 
60
  smishing_boost = 0.30 * smishing_count
61
  other_scam_boost = 0.30 * other_scam_count
62
 
63
+ found_urls = re.findall(r"(https?://[^\s]+|\b(?:[a-zA-Z0-9.-]+\.(?:com|net|org|edu|gov|mil|io|ai|co|info|biz|us|uk|de|fr|es|ru|jp|cn|in|au|ca|br|mx|it|nl|se|no|fi|ch|pl|kr|vn|id|tw|sg|hk))\b)", lower_text)
64
  if found_urls:
65
  smishing_boost += 0.35
66