Fuzzy Logic & Thresholds

Understanding how DelPHI uses fuzzy matching and confidence thresholds to handle medical term variations and optimize PHI detection accuracy.

What is Fuzzy Logic?

Fuzzy logic allows DelPHI to recognize medical terms even when they're misspelled, abbreviated, or written differently. Instead of exact matches, it calculates similarity scores.

🎯 Purpose

Preserve legitimate medical terms while catching PHI variations

⚡ Algorithm

Uses Levenshtein distance and phonetic matching

Medical Term Database

MeSH Terms
263,931
Additional Medical
149
NLTK Words
235,892
Total Terms
493,255

Fuzzy Matching Examples

Original: "Dr. John Smith"
Score: 95%
Recognized variants:
"Dr. J. Smith"
"John Smith MD"
"Dr. Smith"
"J Smith"
Medical term preserved
Original: "Massachusetts General Hospital"
Score: 88%
Recognized variants:
"Mass General"
"MGH"
"Mass. Gen. Hospital"
"Massachusetts Gen"
Medical term preserved
Original: "Acetaminophen"
Score: 85%
Recognized variants:
"acetaminofen"
"acetominophen"
"paracetamol"
"tylenol"
Medical term preserved

How It Works

1. String Similarity

distance = levenshtein("acetaminophen", "acetaminofen")
similarity = 1 - (distance / max_length)
score = similarity * 100 = 92%

2. Phonetic Matching

soundex("Smith") = "S530"
soundex("Smyth") = "S530"
match = true (same code)