chgrdj commited on
Commit
804adda
·
verified ·
1 Parent(s): 6ac60c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -9,12 +9,14 @@ st.write("Enter two domains to check if one is a typosquatted variant of the oth
9
 
10
  domain = st.text_input("Enter the legitimate domain name:")
11
  sim_domain = st.text_input("Enter the potentially typosquatted domain name:")
 
 
12
 
13
  if st.button("Check Typosquatting"):
14
  inputs = [(domain, sim_domain)]
15
  prediction = model.predict(inputs)[0]
16
  print(prediction)
17
- if prediction > 0.5:
18
- st.success(f"The model predicts that '{sim_domain}' is likely a typosquatted version of '{domain}' with {prediction}.")
19
  else:
20
- st.warning(f"The model predicts that '{sim_domain}' is NOT likely a typosquatted version of '{domain}' with {prediction}.")
 
9
 
10
  domain = st.text_input("Enter the legitimate domain name:")
11
  sim_domain = st.text_input("Enter the potentially typosquatted domain name:")
12
+ threshold = st.slider("Set detection threshold", 0.0, 1.0, 0.5)
13
+
14
 
15
  if st.button("Check Typosquatting"):
16
  inputs = [(domain, sim_domain)]
17
  prediction = model.predict(inputs)[0]
18
  print(prediction)
19
+ if prediction > threshold:
20
+ st.success(f"The model predicts that '{sim_domain}' is likely a typosquatted version of '{domain}' with a score of {prediction}.")
21
  else:
22
+ st.warning(f"The model predicts that '{sim_domain}' is NOT likely a typosquatted version of '{domain}' with a score of {prediction}.")