liveBook · Manning

False positive

As explained in Natural Language Processing in Action, Second Edition

A false positive classification error occurs when a system assigns a positive or applicable label to an instance when that label is incorrect.

A false positive occurs when a system assigns a positive or applicable label even though that label is wrong. In a chatbot, it means confidently misunderstanding the user and producing an unsuitable response—often more damaging than admitting uncertainty. section 1.5.2 section 12.6

A hand-written greeting pattern illustrates the trade-off. A broad regular expression may match phrases people would not naturally say, while a narrow one misses slang or misspellings. False positives therefore reveal rules that are too liberal or inclusive. section 1.5.2

Reduce false positives through an iterative review loop:

  • Inspect utterances the chatbot labeled as an existing intent, especially replies that do not fit the user’s expectation. section 12.6
  • For quiz or Socratic bots, examine answers marked incorrect; add genuine correct answers to the appropriate intent examples. section 12.6
  • Add one intent or dialog branch at a time, using real user behavior to guide further changes. section 12.6

A greeting pattern that overmatches

A pattern intended to recognize “Hello Rosa” also matches the beginning of “hi ho, hi ho, it’s off to work ...” and “hey, what’s up.” Such matches may be technically valid but socially implausible, creating false-positive greeting classifications. section 1.5.2

>>> import re             #1
>>> r = "(hi|hello|hey)[ ,:.!]*([a-z]*)"      #2
>>> re.match(r, 'Hello Rosa', flags=re.IGNORECASE)     #3
<re.Match object; span=(0, 10), match='Hello Rosa'>
>>> re.match(r, "hi ho, hi ho, it's off to work ...", flags=re.IGNORECASE)
<re.Match object; span=(0, 5), match='hi ho'>
>>> re.match(r, "hey, what's up", flags=re.IGNORECASE)
<re.Match object; span=(0, 9), match='hey, what'>

Inspect the executable regular-expression matches and compare intended greetings with broad partial matches. section 1.5.2

Figure 12.6 Conversation design workflow
figure

Trace how conversation design, labeling, datasets, and models support repeated detection and correction of false-positive intent labels. section 12.6

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Defines the error through chatbot examples and correction procedures, but does not develop a numerical rate or formal evaluation formula.
Examples
Uses greeting-pattern matches, unsuitable chatbot replies, and quiz answers incorrectly marked as wrong.
What it assumes
Assumes familiarity with chatbot utterances, intent labels, and basic pattern matching while demonstrating the error concretely.
What you can do after
Diagnose misleading chatbot classifications and improve intents by reviewing utterances and updating labeled examples.
How it connects
Connects false positives with false negatives, regular expressions, intent recognition, labeled datasets, and natural language understanding.

Also explained in

Compare how 19 books explain false positive →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.