A false negative is a missed positive: the system fails to identify an instance that belongs to the target class. In a chatbot, search engine, or classifier, the result looks like no match even though a human would recognize one. section 1.5.2 section 10.3.2
False negatives matter because they:
- Reduce recall by omitting appropriate documents, classifications, or generated matches. section 10.3.2
- Reveal overly strict matching, especially when wording, spelling, slang, or meaning differs from the expected pattern. section 1.5.2 section 10.3.2
- Occur alongside false positives when a matching rule is simultaneously too exclusive and too inclusive. section 1.5.2
A greeting pattern misses a valid case
A regular expression matches “Good morning Rosa” but returns no match for “Good Manning Rosa.” If the latter represents a misspelled greeting that should be recognized, the failed match is a false negative. Refining the pattern can improve behavior, but hand-written rules remain vulnerable to slang and misspellings. section 1.5.2
>>> r = r"[^a-z]*([y]o|[h']?ello|ok|hey|(good[ ])(morn[gin']{0,3}|"
>>> r += r"afternoon|even[gin']{0,3}))[\s,;:]{1,3}([a-z]{1,20})"
>>> re_greeting = re.compile(r, flags=re.IGNORECASE) #1
>>> re_greeting.match('Hello Rosa')
<re.Match object; span=(0, 10), match='Hello Rosa'>
>>> re_greeting.match('Hello Rosa').groups()
('Hello', None, None, 'Rosa')
>>> re_greeting.match("Good morning Rosa")
<re.Match object; span=(0, 17), match="Good morning Rosa">
>>> re_greeting.match("Good Manning Rosa") #2
>>> re_greeting.match('Good evening Rosa Parks').groups() #3
('Good evening', 'Good ', 'evening', 'Rosa')
>>> re_greeting.match("Good Morn'n Rosa")
<re.Match object; span=(0, 16), match="Good Morn'n Rosa">
>>> re_greeting.match("yo Rosa")
<re.Match object; span=(0, 7), match='yo Rosa'>
Inspect the greeting pattern's contrasting matches: accepted greetings return match objects, while “Good Manning Rosa” returns no match. section 1.5.2















