predictable
mid
surprising
Privacy: LM runs locally (WebAssembly). Heuristic fallback needs no download.
Heuristic ready (no download)
Text
—
How it works
- LM mode: loads
Xenova/distilgpt2quantized via Transformers.js (WebAssembly). Tokenizes text, runs causal LM, gets logits per position → logprob of actual next token →surprise = (-logprob /9)^0.85core.js:62. - Merge: BPE tokens (Ġ) grouped to words, averaged. Chunked 1200 chars to avoid O(n²).
- Heuristic fallback: no download. Scores by common-word list, length, digits/caps, doc frequency & rare trigrams
core.js:14. - Private: model cached by browser; subsequent runs offline. Multilingual heuristic handles Arabic; LM is English-biased (GPT-2) — heuristic used for Arabic segments.
- Not a detector: high avg ≠ AI; use as writing aid / calibration.