Skip to content
ML Academy

Neural networks, deep learning, NLP · insight-1460

Keep invariance and directional tests for a text classifier next to its accuracy report

Evidence type
practitioner heuristic
Difficulty
medium
Roles
Data scientist, Applied AI, ML engineer
Industries
cross-industry

Summary: situation, action, reason, boundary

  1. Situation

    A complaint-priority classifier passes its test set and then fails on trivial rewrites in the first demo.

  2. Action

    Maintain small templated groups: invariance (names, airports, typos must not change the label), directional (adding "not" must move the score the expected way) and minimum functionality (obvious cases), and run them on every candidate.

  3. Reason

    The CheckList paper proposes behavioural testing with a matrix of linguistic capabilities and test types, and reports critical failures in commercial and state-of-the-art models and more bugs found by practitioners using it.

  4. Boundary

    Classifiers, extractors and similarity models in text products.

Symptom or risk

Aggregate accuracy hides brittle behaviour on typos, swapped names and negation, and regressions between model versions go unseen.

Exceptions

Capabilities your product never meets.

Trade-offs

Templates are synthetic and written by you; passing them proves little beyond those cases.

Pitfalls

Writing tests from the model's own outputs; treating a pass rate as accuracy.

Lessons and concepts

Claims and their sources