Hello-SimpleAI/HC3
Viewer โข Updated โข 48.6k โข 5.67k โข 244
How to use Nandish29/hw1-hc3-detector with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="Nandish29/hw1-hc3-detector") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Nandish29/hw1-hc3-detector")
model = AutoModelForSequenceClassification.from_pretrained("Nandish29/hw1-hc3-detector", device_map="auto")This model classifies English answer text as either human-written or
ChatGPT-generated. It was created by fine-tuning
sentence-transformers/all-MiniLM-L6-v2 on the HC3 dataset.
sentence-transformers/all-MiniLM-L6-v2LABEL_0: Human-writtenLABEL_1: ChatGPT-generatedThe model can classify English answer text according to whether it resembles the human-written or ChatGPT-generated examples in HC3.
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="Nandish29/hw1-hc3-detector"
)
print(classifier("Text to classify"))
The model was trained on the English HC3 dataset. Only answer text was used as model input.
The pretrained MiniLM encoder and a newly initialized two-class classification head were fine-tuned together.
Both models were evaluated on the same held-out HC3 test set.
| Model | Test accuracy |
|---|---|
| Frozen MiniLM embeddings with logistic regression | 0.8449 |
| Fine-tuned MiniLM sequence classifier | 0.9901 |
Base model
nreimers/MiniLM-L6-H384-uncased