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