Challenge - 5 Problems
PII Protection Pro
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
What is the primary goal of PII detection in text data?
Imagine you have a document containing names, phone numbers, and addresses. What is the main purpose of PII detection in this context?
Attempts:
2 left
💡 Hint
Think about privacy and data protection.
✗ Incorrect
PII detection aims to find personal data like names or phone numbers so they can be secured or removed to protect privacy.
❓ Predict Output
intermediate2:00remaining
What is the output of this PII redaction code snippet?
Given the following Python code that replaces email addresses with '[REDACTED]', what will be printed?
Prompt Engineering / GenAI
import re text = 'Contact me at alice@example.com or bob@example.org.' redacted = re.sub(r'\b[\w.-]+@[\w.-]+\.\w+\b', '[REDACTED]', text) print(redacted)
Attempts:
2 left
💡 Hint
Look at the regular expression and what it matches.
✗ Incorrect
The regex matches all email addresses and replaces them with '[REDACTED]', so both emails are replaced.
❓ Model Choice
advanced2:00remaining
Which model type is best suited for detecting PII in unstructured text?
You want to build a system that finds names, phone numbers, and addresses in messy text data. Which model type is most appropriate?
Attempts:
2 left
💡 Hint
Think about models that find specific words or phrases in text.
✗ Incorrect
NER models are designed to find and classify entities like names and addresses in text, making them ideal for PII detection.
❓ Metrics
advanced1:30remaining
Which metric best measures the accuracy of a PII detection model?
You have a PII detection model. Which metric tells you how many PII items it correctly finds without too many mistakes?
Attempts:
2 left
💡 Hint
Consider metrics that handle imbalanced classes and both false positives and false negatives.
✗ Incorrect
F1 score balances precision (correctness) and recall (completeness), which is crucial for PII detection.
🔧 Debug
expert2:30remaining
Why does this PII redaction code fail to redact phone numbers?
Review the code below. It redacts emails but fails to redact phone numbers. What is the main reason?
Prompt Engineering / GenAI
import re text = 'Call me at 123-456-7890 or email me at jane@domain.com.' redacted = re.sub(r'\b[\w.-]+@[\w.-]+\.\w+\b', '[REDACTED]', text) print(redacted)
Attempts:
2 left
💡 Hint
Look at what the regex pattern is designed to find.
✗ Incorrect
The regex targets email formats only, so phone numbers are not matched or replaced.