--- title: Detection and Plagiarism Check emoji: 🕵️‍♂️ colorFrom: indigo colorTo: blue sdk: docker app_file: Dockerfile pinned: false --- # Detection and Plagiarism Check API 🕵️‍♂️ This API detects if an uploaded **essay PDF** is **human-written or AI-generated** using a powerful RoBERTa-based model. --- ## 🚀 Endpoint ### 📄 `POST /detect` Upload a PDF essay to determine how much of it is likely AI-generated. **Request:** - `Content-Type`: `multipart/form-data` - `Body`: `file` (PDF only) **Response:** ```json { "ai_generated_percentage": 87.43 } 💡 Usage Examples 🔧 Using cURL: bash Copy Edit curl -X 'POST' \ 'https://essay-grader-detection-and-plagiarism-check.hf.space/detect' \ -H 'accept: application/json' \ -H 'Content-Type: multipart/form-data' \ -F 'file=@your_essay.pdf' 🐍 Using Python Requests: python Copy Edit import requests url = "https://essay-grader-detection-and-plagiarism-check.hf.space/detect" files = {"file": open("your_essay.pdf", "rb")} response = requests.post(url, files=files) result = response.json() print(result) ⚙️ Technical Stack AI Content Detection: roberta-base-openai-detector PDF Text Extraction: PyMuPDF (fitz) API Framework: FastAPI Deployment: Hugging Face Spaces (FastAPI Runtime) 👤 Created By Christian Mpambira BED-COM-22-20 University of Malawi