Skip to content

Commit f57d73d

Browse files
committed
Add disclosure protection description and enhance content handling in reports
1 parent e48e8a2 commit f57d73d

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

src/assets/synthetic-data.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,13 @@ def run():
392392
'reportType': 'table',
393393
'titleKey': 'syntheticData.disclosureProtectionTitle',
394394
'showIndex' : False,
395+
'preContent' : [{
396+
'contentType': 'text',
397+
'textKey': 'syntheticData.disclosureProtectionDescription'
398+
},{
399+
'contentType': 'text',
400+
'text': f"Score: {dp_score:.3f}"
401+
}],
395402
'data': dp_report_df.to_json(orient="records"),
396403
}
397404
]

src/components/DistributionReport.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ function countCategory2ForCategory1(
5959
type additionalContent = {
6060
contentType: string;
6161
textKey?: string;
62+
text?: string;
6263
params?: Record<string, string | number | boolean>;
6364
}[];
6465

@@ -161,11 +162,12 @@ export const DistributionReport = (
161162
key={index}
162163
className="-mt-2 text-gray-800 markdown"
163164
>
164-
{t(
165-
content.textKey ??
166-
'',
167-
content.params
168-
)}
165+
{content.text ??
166+
t(
167+
content.textKey ??
168+
'',
169+
content.params
170+
)}
169171
</MarkdownWithTooltips>
170172
);
171173
}
@@ -190,11 +192,12 @@ export const DistributionReport = (
190192
key={index}
191193
className="-mt-2 text-gray-800 markdown"
192194
>
193-
{t(
194-
content.textKey ??
195-
'',
196-
content.params
197-
)}
195+
{content.text ??
196+
t(
197+
content.textKey ??
198+
'',
199+
content.params
200+
)}
198201
</MarkdownWithTooltips>
199202
);
200203
} else if (

src/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ For categorical (or boolean) columns the following metrics are computed:
189189
Green cells signify that the pairwise correlation was accurately captured, with 0 representing the best possible score. Red cells indicate poor capture of the pairwise correlation.`,
190190
efficacyMetricsTitle: 'Efficacy metrics',
191191
disclosureProtectionTitle: 'Privacy metrics',
192+
disclosureProtectionDescription: `A class to compute the disclosure protection metric for synthetic data. This metric measures the proportion of synthetic records that are too similar (within a defined threshold) to real records, posing a disclosure risk.`,
192193
outputDataTitle: '5. Generated synthetic data',
193194
moreInfoTitle: '6. More information',
194195
correlationDifference:

0 commit comments

Comments
 (0)