electra-ai-human-classifier
Estimates whether an English text was written by a person or generated by a language model. It's ELECTRA-small with mean pooling over tokens and a two-layer classification head (13.5M parameters). Try it in the AI Text Analyzer Space.
This is a probability, not proof. Don't use it on its own to decide whether someone used AI.
Files
model.safetensors: the weights (encoder.*for ELECTRA,head.*for the classifier)config.json: the base model, labels (0 = AI, 1 = human) and scoring settingstokenizer.json,tokenizer_config.json: the ELECTRA WordPiece tokenizer
How a text is scored
The text is split into chunks of 200 words. Each chunk is truncated to 256 subwords and
scored, and the document's P(human) is the mean over its chunks. Below 0.5 it reads as AI.
The model class and scoring code are in the Space's
detector.py.
Training data
| Label | Sources |
|---|---|
| AI | Claude conversations (Havoc999/The-Claude-Dataset); Reddit-style replies generated with DeepSeek, Dolphin, Llama 3.2 and Phi-4 |
| Human | Reddit comments, ConvoKit subreddit corpora, 20 Newsgroups (via scikit-learn), Wikipedia (2023-11 dump, before most AI-written edits) |
Each class was balanced within a casual and a formal register (86,672 training documents), and trained for 2 epochs. The train/test split is by author, article or prompt, so none of them appears on both sides.
Evaluation
- Held-out test (37,657 documents, same sources): accuracy 0.997, AI F1 0.988, human F1 0.998.
- 9 unseen documents, including Gemini 3.1 Pro and Claude Opus 5 text, which weren't in training: 8/9 correct. The miss was a Claude text scored 0.61 human.
Limitations
- Short texts are unreliable: under ~100 words there's little to go on.
- AI text that has been edited or paraphrased by a person, or written by models and styles far from the training data, can read as human.
- Human writing that is very formal or formulaic can read as AI.
- English only.
- Downloads last month
- 28
Model tree for shonenash/electra-ai-human-classifier
Base model
google/electra-small-discriminator