VRahul98/SQL-Injection-predictor
0
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 