Essay-Grader's picture
Restore Dockerfile and fix README metadata
852f8ec
metadata
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:

{
  "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