Nyaya · a scam filter you can argue with · project site

Every belief it holds, and the evidence that earned it.

This filter learned 47 rules from 5,574 real text messages in 2.13 seconds on a CPU — no GPU, no network, no weights. Below is all of it. Read a belief, disagree with it, switch it off, and watch the verdict change. That is the whole product claim, and it takes about ten seconds to check.

The message

scored on every keystroke

Editing this text rescores it immediately. The verdict and the list of rules that fired are announced as they change.

What fired

total evidence0

The belief ledger

Forty-seven learned beliefs. Each is a toggle button: activate it to switch that belief off, and the verdict is recalculated and announced.

What a readable filter shows you that a black box cannot

Scroll the ledger and three things are visible that no accuracy score would ever have told you. None of them is a design choice. They are what the learner actually found, and they are only findable because every belief is a sentence.

contains the word 'lor'  −1
Fired on 145 messages, right 100% of the time. Lor is a Singlish particle. The corpus is Singaporean, and the filter learned the dialect rather than the fraud. Nobody told it that. You just read it.
asks for a fee to claim a prize  −1
I wrote this signal for Indian scams. On this corpus it fired 7 times and came out vouching for the sender. My best India-specific intuition has almost no evidence behind it here, and the ledger says so in public.
40 of 47 rules are ordinary words
but, that, sorry, home, later. The filter mostly learned what a conversation looks like, not what fraud looks like. Switch them all off with the button above and see how much of the verdict was resting on them.

Every one of those is a limitation, and every one is legible in about a minute because the beliefs are written in words instead of stored as weights. That is the argument: a filter you can audit is one you can correct. The thing protecting a person should be a thing that person is allowed to read.

And here is the baseline that beats it

On the identical split, a textbook algorithm from the 1990s scores higher. I am publishing that here rather than leaving it for you to find in five minutes, because it is the actual result and it is more interesting than a win would be.

Held-out results on the UCI SMS corpus
methodprecisionrecallF1fitwhat you can read
nyaya readable rules100.0%77.8%0.8751.85 s47 sentences
naive Bayes98.7%94.4%0.9650.06 s7,930 weights
hand-written keyword list63.4%71.6%0.6720.00 s14 words
majority class0.0%0.0%0.0000.00 s1 constant

Readability costs about nine points of F1 and sixteen points of recall. That price had never been published before. It is a real cost, paid for a real thing: 7,930 naive-Bayes weights cannot be opened, understood, argued with or edited by the person they are protecting. Forty-seven sentences can — you just did it. Closing that recall gap while keeping the rules readable is an open research question here, not a claim already won.

Run all of it yourself

No API key, no GPU, no dependencies beyond the Python standard library. The page you are reading uses the exact rules and scoring the repository produces.

git clone https://github.com/let-the-dreamers-rise/nyaya && cd nyaya
# learn this filter from 5,574 real messages, then open skill.py
python -m nyaya learn data/sms.tsv -o skill.py
# the table above, reproduced
python scripts/text_baselines.py
# the world-model benchmark: 25 episodes, cost reported next to quality
python -m bench.run --corpus bench/corpus-heldout