extracting-pii-entities
Detect PHI/PII spans in clinical text with OpenMed's extract_pii without altering the text. Use when the user wants to find names, dates, MRNs, phone numbers, addresses, SSNs, or other identifiers and get their offsets and labels (not redact them), inspect what would be removed before de-identifying, route spans to a custom redactor, normalize labels to a canonical taxonomy, or filter by confidence and language. Covers extract_pii, the PIIEntity fields, CANONICAL_LABELS / normalize_label, and how it differs from deidentify. Pairs before reidentifying-text and deidentifying-clinical-text.
npx skills add maziyarpanahi/openmed --skill extracting-pii-entities --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Extracting PII Entities `openmed.extract_pii` finds PHI/PII spans and **returns them without changing the text**. Use it when you need to *see* the identifiers — to audit, route to a custom redactor, or decide a policy — rather than produce redacted output. It runs on-device. ## When to use - You want the **spans and labels** of identifiers, with the original text intact. - You need a **preview** of what `deidentify` would act on before committing. - You are feeding detected spans into a **downstream redactor** (your own, Presidio, or `deidentify`). - You want to **normalize** model labels to a stable canonical taxonomy. If you instead want redacted/masked output directly, use `deidentifying-clinical-text` (`openmed.deidentify`). If you need reversible masking, see `reidentifying-text`. ## extract_pii vs deidentify | | `extract_pii` | `deidentify` | | --- | --- | --- | | Changes the text? | **No** | Yes (mask/remove/replace/hash/shift) | | Returns | `PredictionResult` (spans) | `DeidentificationResult` (redacted text) | | Default threshold | `0.5` | `0.7` (safety-biased) | | Use for | detection, audit, routing | producing safe output | ## Install ```bash pip install "openmed[hf]"
- When to use
- extractpii vs deidentify
- Install
- Quick start
- Signature & key parameters
- Normalize labels to the canonical taxonomy
- Feed spans to a downstream redactor
- Hand-off to / from OpenMed
- Edge cases & gotchas
- Standards & references
pip install "openmed[hf]"
What does the extracting-pii-entities skill do?
Detect PHI/PII spans in clinical text with OpenMed's extract_pii without altering the text. Use when the user wants to find names, dates, MRNs, phone numbers, addresses, SSNs, or other identifiers and get their offsets and labels (not redact them), inspect what would be removed before de-identifying, route spans to a custom redactor, normalize labels to a canonical taxonomy, or filter by confidence and language. Covers extract_pii, the PIIEntity fields, CANONICAL_LABELS / normalize_label, and how it differs from deidentify. Pairs before reidentifying-text and deidentifying-clinical-text.
How do I install it?
Run `npx skills add maziyarpanahi/openmed --skill extracting-pii-entities --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From maziyarpanahi/openmed, a repository with 4,851 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.