import streamlit as st from sentence_transformers import CrossEncoder model_name = "Anvilogic/CE-typosquat-detect" 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:") if st.button("Check Typosquatting"): inputs = [(domain, sim_domain)] prediction = model.predict(inputs)[0] if prediction > 0.5: st.success(f"The model predicts that '{sim_domain}' is likely a typosquatted version of '{domain}'.") else: st.warning(f"The model predicts that '{sim_domain}' is NOT likely a typosquatted version of '{domain}'.")