pii_replay
pii_replay
¶
Classes:
| Name | Description |
|---|---|
PIIReplayData |
Per-column PII data listed in the PII Replay section of the SQS report. |
PIIReplay |
PII Replay metric -- counts PII values from the training data appearing in the synthetic data. |
PIIReplayData
pydantic-model
¶
Bases: BaseModel
Per-column PII data listed in the PII Replay section of the SQS report.
Fields:
-
column_name(str) -
column_assigned_type(str) -
pii_type(str) -
total_training_data(int) -
unique_training_data(int) -
total_synthetic_data(int) -
unique_synthetic_data(int) -
unique_synthetic_data_percentage(float)
column_name
pydantic-field
¶
The name of the column with PII data.
column_assigned_type
pydantic-field
¶
The assigned type for the column (text, unique identifier, date, email, etc.).
pii_type = UNKNOWN_ENTITY
pydantic-field
¶
Type of the PII data in the column. For non-text fields, same as column_assigned_type. For text fields, the PII entities detected within the text (race, SSN, address, etc.).
total_training_data = 0
pydantic-field
¶
Total rows in the training data that contain PII values.
unique_training_data = 0
pydantic-field
¶
Count of distinct PII values for this entity in the training column.
total_synthetic_data = 0
pydantic-field
¶
Number of synthetic rows whose column value matches a training PII value.
unique_synthetic_data = 0
pydantic-field
¶
Count of distinct training PII values that appear in the synthetic column.
unique_synthetic_data_percentage = 0
pydantic-field
¶
Percentage of distinct training PII values replayed in the synthetic data (unique_synthetic_data / unique_training_data * 100).
PIIReplay
pydantic-model
¶
Bases: Component
PII Replay metric -- counts PII values from the training data appearing in the synthetic data.
For each classified PII entity, reports total and unique replay counts. This component does not produce a numeric score; it surfaces PII leakage details for the HTML report.
Fields:
-
score(EvaluationScore) -
name(str) -
training_total_records(int) -
synthetic_total_records(int) -
pii_replay_data(list[PIIReplayData]) -
skipped_reason(str | None)
training_total_records = 0
pydantic-field
¶
Total rows in the training data.
synthetic_total_records = 0
pydantic-field
¶
Total rows in the synthetic data.
pii_replay_data = list()
pydantic-field
¶
Per-column / per-entity replay statistics.
skipped_reason = None
pydantic-field
¶
Why PII replay could not run, such as a failed PII detection, or None.
jinja_context
cached
property
¶
Template context with PII replay statistics and entity type list.
from_evaluation_datasets(evaluation_datasets, config=None)
staticmethod
¶
Compute PII replay counts from classified entity metadata.
Source code in src/nemo_safe_synthesizer/evaluation/components/pii_replay.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | |