File size: 1,370 Bytes
a4daeb9
 
 
 
7f7ce36
852f8ec
1a42d94
a4daeb9
 
 
c1a1632
7c65163
a4daeb9
c70605c
8a681a9
7c65163
8a681a9
c70605c
8a681a9
c70605c
8a681a9
c70605c
8a681a9
c70605c
7c65163
c70605c
 
8a681a9
 
7c65163
c70605c
8a681a9
c70605c
8a681a9
7c65163
c70605c
7c65163
c70605c
 
 
 
8a681a9
c70605c
8a681a9
 
 
 
c70605c
 
 
 
8a681a9
 
c70605c
8a681a9
 
 
 
 
 
 
c70605c
 
7c65163
c70605c
7c65163
c70605c
8a681a9
c70605c
8a681a9
c70605c
 
 
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
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