import streamlit as st import requests HF_BACKEND_URL = "https://your-backend-url.hf.space" # Update this with your backend link st.title("🚀 Plagiarism & AI Detector") # Text Plagiarism st.subheader("🔍 Check Text Plagiarism") text = st.text_area("Enter text to check for plagiarism") if st.button("Check Plagiarism"): response = requests.post(f"{HF_BACKEND_URL}/check_text", params={"text": text}) st.json(response.json()) # Code Plagiarism st.subheader("💻 Check Code Plagiarism") code = st.text_area("Paste code to check plagiarism") if st.button("Check Code Plagiarism"): response = requests.post(f"{HF_BACKEND_URL}/check_code", params={"code": code}) st.json(response.json()) # AI Detection st.subheader("🤖 Detect AI-Generated Content") ai_text = st.text_area("Enter text to check AI detection") if st.button("Detect AI"): response = requests.post(f"{HF_BACKEND_URL}/detect_ai", params={"text": ai_text}) st.json(response.json()) # PDF Upload st.subheader("📂 Upload PDF for Plagiarism Check") pdf = st.file_uploader("Upload a PDF file", type=["pdf"]) if pdf: files = {"file": pdf.getvalue()} response = requests.post(f"{HF_BACKEND_URL}/upload_pdf", files=files) st.json(response.json())