Team Ai
Apppublic

VRahul98/SQL-Injection-predictor

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
app.py21 linesDownload Raw Back to root
1import streamlit as st2import joblib3 4# Load the model and vectorizer5model = joblib.load("model.pkl")6vectorizer = joblib.load("vectorizer.pkl")7 8# Streamlit UI9st.title("SQL Injection Prediction ๐Ÿ”")10 11user_input = st.text_area("Enter your query or input string:")12 13if st.button("Predict"):14    if user_input.strip() == "":15        st.warning("Please enter a query to predict.")16    else:17        vector = vectorizer.transform([user_input])18        prediction = model.predict(vector)[0]19        label = "SQL Injection โŒ" if prediction == 1 else "Benign โœ…"20        st.subheader(f"Prediction: {label}")21