ky1916/HATCorpus
Updated โข 8 โข 1
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}
}
Base model
google-bert/bert-base-uncased