Downloads · 30 days
19
56% of all-time downloads
JacobWu123/hw1-hc3-detector
hw1-hc3-detector is a text classification model from JacobWu123. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
A binary classifier that predicts whether an answer from the HC3 dataset was written by a human (label 0) or by ChatGPT (label 1). It was built for a course homework (CS546 HW1) on adapting pretrained language models.
Downloads · 30 days
19
56% of all-time downloads
All-time downloads
34
Public
Parameters
22.7M
90.9 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors90.9 MB · 99%
From the Hugging Face model README
A binary classifier that predicts whether an answer from the HC3 dataset was written by a human (label 0) or by ChatGPT (label 1). It was built for a course homework (CS546 HW1) on adapting pretrained language models.
| Model | Test accuracy | Macro F1 | Misclassified |
|---|---|---|---|
Baseline: frozen all-MiniLM-L6-v2 embeddings + logistic regression | 0.8449 | 0.8449 | 724 |
This model: full fine-tuning of all-MiniLM-L6-v2 | 0.9921 | 0.9921 | 37 |
Confusion matrix of the fine-tuned model on the test split (rows are true labels, columns are predictions):
| pred human | pred ChatGPT | |
|---|---|---|
| human | 2298 | 36 |
| ChatGPT | 1 | 2333 |
sentence-transformers/all-MiniLM-L6-v2, loaded with AutoModelForSequenceClassification (2 labels, cross-entropy)Hello-SimpleAI/HC3 (English, all.jsonl, revision 4d0ff18). The first non-empty human answer and the first non-empty ChatGPT answer were kept for each question. The questions were split 80/10/10 with seed 42, so both answers to a question stay in the same split. Train/val/test sizes are 37,334 / 4,666 / 4,668 answers, balanced between the two classes.from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
repo = "JacobWu123/hw1-hc3-detector"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSequenceClassification.from_pretrained(repo).eval()
inputs = tok("Your answer text here", truncation=True, max_length=256, return_tensors="pt")
with torch.no_grad():
probs = model(**inputs).logits.softmax(-1)[0]
print({"human": probs[0].item(), "ChatGPT": probs[1].item()})