← Lesson
Drift
Joeven
Run
Reset
Python loads on first run
# Train keyword: "crash" means urgent. Production switched to "down". def policy(text): return 1 if "crash" in text.lower().split() else 0 train = [ ("server crash tonight", 1), ("hello", 0), ("crash in payments", 1), ("thanks", 0), ] prod = [ ("site is down", 1), ("hello", 0), ("down in payments", 1), ("thanks", 0), ] def acc(rows): return sum(policy(x) == y for x, y in rows) / len(rows) print("train acc", acc(train)) print("prod acc", acc(prod)) print("same policy, new words, silent fail")
Run to execute this in your browser. Nothing is sent to a server.