darwinkernelpanic/ai-detector-pgx
By darwinkernelpanic · ↓ 3 · ♥ 0 · Updated 2026-02-20
What's in this repo
This page lists the files in darwinkernelpanic/ai-detector-pgx.
- No .onnx files in this repository
- 8 files, including 3 .json, 1 .md, 1 .js, 1 .py, 1 .safetensors
- Last updated 2026-02-20
ONNX files
This repository has no .onnx files. See the full file list on the right for other formats.
How to use
These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.
README
AI Detector PGX
BERT-based classifier for detecting AI-generated text in student essays. Trained on PG assignments.
Quick Start
Python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_id = "darwinkernelpanic/ai-detector-pgx"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
text = "The mitochondria is the powerhouse of the cell..."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=1)
ai_prob = probs[0][1].item()
print(f"AI Probability: {ai_prob:.2%}")
JavaScript (ONNX)
import * as ort from 'onnxruntime-web';
const session = await ort.InferenceSession.create('model.onnx');
// Tokenize with @xenova/transformers, then run inference
const results = await session.run({ input_ids, attention_mask });
const logits = results.logits.data;
const aiProb = Math.exp(logits[1]) / (Math.exp(logits[0]) + Math.exp(logits[1]));
Model Details
- Base: prajjwal1/bert-tiny (4.4M params)
- Classes: human (0), ai (1)
- Sequence length: 512 tokens
- ONNX size: 255MB
Limitations
Trained on academic essays — may not generalize to all text types.
Model info
Created: 2026-02-20
Updated: 2026-02-20
View on Hugging FaceFiles (8)
Related models
More from darwinkernelpanic
No other models by this author.