File size: 914 Bytes
ee64b99
 
 
bd2ad61
ee64b99
 
 
 
 
 
 
804adda
 
ee64b99
 
8a400fb
ee64b99
6ac60c6
804adda
 
ee64b99
804adda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import streamlit as st
from sentence_transformers import CrossEncoder

model_name = "./" 
model = CrossEncoder(model_name)

st.title("Typosquatting Detection App")
st.write("Enter two domains to check if one is a typosquatted variant of the other.")

domain = st.text_input("Enter the legitimate domain name:")
sim_domain = st.text_input("Enter the potentially typosquatted domain name:")
threshold = st.slider("Set detection threshold", 0.0, 1.0, 0.5)


if st.button("Check Typosquatting"):
    inputs = [(sim_domain,domain)]
    prediction = model.predict(inputs)[0]
    print(prediction)
    if prediction > threshold:
        st.success(f"The model predicts that '{sim_domain}' is likely a typosquatted version of '{domain}' with a score of {prediction}.")
    else:
        st.warning(f"The model predicts that '{sim_domain}' is NOT likely a typosquatted version of '{domain}' with a score of {prediction}.")