File size: 1,248 Bytes
5bee5f1
f0cd87e
5bee5f1
f0cd87e
5bee5f1
f0cd87e
5bee5f1
f0cd87e
 
 
 
 
 
5bee5f1
f0cd87e
 
 
 
 
 
5bee5f1
f0cd87e
 
 
 
 
 
5bee5f1
f0cd87e
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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())