Downloads · 30 days
20
34% of all-time downloads
ky1916/hatcorpus-bert-authorship
hatcorpus-bert-authorship is a text classification model from ky1916. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
This model is a BERT-based binary text classifier trained to distinguish between human-written and AI-generated English text.
Downloads · 30 days
20
34% of all-time downloads
All-time downloads
58
Public
Repo size
876 MB
Likes
1
Public
Click a slice to open those files.
.bin438 MB · 100%
From the Hugging Face model README
This model is a BERT-based binary text classifier trained to distinguish between human-written and AI-generated English text.
0 → Human-written1 → AI-generatedThe model was trained on HATCorpus, a curated dataset of human and AI-authored text.
This model is intended for:
It is not intended for:
For dataset details, see:
👉 https://huggingface.co/datasets/ky1916/HATCorpus
| Metric | Value |
|---|---|
| Accuracy | 93.58% |
| Precision | 88.04% |
| Recall | 96.43% |
| F1-score | 92.05% |
(Evaluated against dataset at https://www.kaggle.com/datasets/shanegerami/ai-vs-human-text)
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("your-username/hatcorpus-bert-authorship")
model = AutoModelForSequenceClassification.from_pretrained("your-username/hatcorpus-bert-authorship")
text = "This is an example sentence."
inputs = tokenizer(text, return_tensors="pt", truncation=True)
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=1).item()
print("AI-generated" if prediction == 1 else "Human-written")
If you use this model in your research, please cite both the model and dataset:
@model{hatcorpus_bert_2025,
title = {HATCorpus BERT Authorship Classifier},
year = {2025},
publisher = {Hugging Face},
note = {Fine-tuned from bert-base-uncased for human vs AI text classification}
}