indhupamula's picture
Update app.py
f0cd87e verified
raw
history blame
1.25 kB
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())