PHI Guard 850k v0.6 Fast - Residual PHI Leak

Description

PHI Guard 850k v0.6 scores de-identified clinical text for residual PHI that masking may have missed. It returns one document-level category per input document. It does not find or remove PHI, and a negative result does not certify privacy safety. Rounded size: about 850 thousand parameters. Fast is a rounded-size variant name, not a measured speed claim.

Predicted Entities

PHI_LEAK, NO_PHI_LEAK, UNKNOWN, REVIEW_REQUIRED

Copy S3 URI

How to use

Load DecisionModel.pretrained(“phi_guard_850k_v0.6_fast”, “en”, “clinical/models”). Pass this name explicitly. Do not call setMode. Score the final de-identified note, not the original. The sample contrasts a masked note with Pt Maria Delgado, DOB 03/14/1956. Inspect result and metadata.status. A negative label is not a privacy certificate. The lookup name is lowercase.

from pyspark.ml import Pipeline
from sparknlp.base import DocumentAssembler
import sparknlp_jsl
from sparknlp_jsl.annotator.classification import DecisionModel
spark = sparknlp_jsl.start()
notes = spark.createDataFrame([
 ("masked", "[NAME] visited [HOSPITAL] on [DATE]."), ("leaked", "Pt Maria Delgado, DOB 03/14/1956.")], ["case_id", "text"])
doc = DocumentAssembler().setInputCol("text").setOutputCol("document")
guard = DecisionModel.pretrained("phi_guard_850k_v0.6_fast", "en", "clinical/models")\
 .setInputCols("document").setOutputCol("phi_leak")
Pipeline(stages=[doc, guard]).fit(notes).transform(notes).selectExpr(
 "case_id", "phi_leak[0].result AS label", "phi_leak[0].metadata.status AS status"
).show(truncate=False)

import com.johnsnowlabs.nlp.DocumentAssembler
import com.johnsnowlabs.nlp.annotators.classification.DecisionModel
import org.apache.spark.ml.Pipeline
import org.apache.spark.sql.SparkSession
val spark = SparkSession.builder().getOrCreate()
import spark.implicits._
val notes = Seq(("masked", "[NAME] visited [HOSPITAL] on [DATE]."), ("leaked", "Pt Maria Delgado, DOB 03/14/1956.")).toDF("case_id", "text")
val doc = new DocumentAssembler().setInputCol("text").setOutputCol("document")
val guard = DecisionModel.pretrained("phi_guard_850k_v0.6_fast", "en", "clinical/models")
 .setInputCols("document").setOutputCol("phi_leak")
new Pipeline().setStages(Array(doc, guard)).fit(notes).transform(notes).selectExpr(
 "case_id", "phi_leak[0].result AS label", "phi_leak[0].metadata.status AS status").show(false)

Results

+---------+-------------+--------+
| case_id | label       | status |
+---------+-------------+--------+
| masked  | NO_PHI_LEAK | scored |
| leaked  | PHI_LEAK    | scored |
+---------+-------------+--------+

Model Information

Model Name: phi_guard_850k_v0.6_fast
Compatibility: Healthcare NLP 7.0.1+
License: Licensed
Edition: Official
Input Labels: [document]
Output Labels: [phi_guard]
Language: en
Size: 3.5 MB
Dependencies: DocumentAssembler