GeezerVison is showing github.com — Only the first of several US phone numbers in the same input gets de-identified · Issue #3302 · googleapis/google-cloud-java
Only the first of several US phone numbers in the same input gets de-identified #3302Labels api: dlpIssues related to the Sensitive Data Protection API.type: questionRequest for information or clarification. Not an issue. DescriptionI'm sending an input string with several phone numbers to the DLP service, and it seems like only the first occurrence gets de-identified. My input looks like this: "My phone number is 408.867.5309 or 650.867.5309". My config is:
- Using all available InfoTypes. PHONE_NUMBER is definitely in there.
- The string gets set as one single Row in a Table which is added to a ContentItem.
The request code looks like this:
DeidentifyContentRequest request =
DeidentifyContentRequest.newBuilder()
.setParent(ProjectName.of(projectId).toString())
.setDeidentifyConfig(deidentifyConfig)
.setInspectConfig(inspectConfig)
.setItem(contentItem)
.build();
Only the first occurrence of the phone number in the input string above gets de-identified. Activityandreamlin commented on May 23, 2018 Calling the redaction method with a raw REST call
{
"inspectConfig": {
"infoTypes": [
{
"name": "PHONE_NUMBER"
}
]
},
"deidentifyConfig": {
"infoTypeTransformations": {
"transformations": [
{
"infoTypes": [
{
"name": "PHONE_NUMBER"
}
],
"primitiveTransformation": {
"redactConfig": {}
}
}
]
}
},
"item": {
"table": {
"rows": [
{
"values": [
{
"stringValue": "My phone number is 408.867.5309 or 650.867.5309"
}
]
}
],
"headers": [
{
"name": "sample"
}
]
}
}
}
also returns an inaccurate response:
My phone number is or 650.867.5309
so this error is likely an API error rather than a Java client library error.
An internal bug for the DLP team will be filed for this issue.
Thanks for bringing it to our attention! added and removed type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. on May 23, 2018andreamlin commented on May 23, 2018 If you call setMinLikelihood(VERY_UNLIKELY) on the inspectConfig, the result will be "My phone number is or "
The heuristic for phone numbers just didn't conclude, with a high enough confidence, that the second phone number was a phone number.
Hope that solves the problem! andreamlin commented on May 23, 2018 Closing the issue for now. Feel free to reopen or recomment if there are further related problems. andreamlin commented on Jun 5, 2018 Just a follow up, the DLP team responded to the bug saying that they are looking to adjust their heuristics to have higher confidence on that second phone number in the example you provided. henrik-io commented on Jun 5, 2018 Awesome! Meanwhile, I followed the suggestion in the previous response and set the min likelihood to VERY_UNLIKELY and it seemed to get me past my issue.
MetadataMetadataapi: dlpIssues related to the Sensitive Data Protection API.type: questionRequest for information or clarification. Not an issue. DevelopmentNo branches or pull requestsIssue actions
|