question

bkosch avatar image
0 Votes"
bkosch asked romungi-MSFT answered

Text Analytics API PII masking Date category

I am trying to mask dates from a body of text using the Text Analytics PII API and understand to do so I can use the DateTime category. The category masks dates just fine, but I want to keep phrases such as 'yesterday' and 'last week' unmasked. I tried using the subcategory "Date" which is supposed to mask only calendar dates, but the input "November 22nd 1987" does not get masked in the output.

Any guidance on what the Date subcategory actually masks? And is there any advice on how to mask dates but not times of day?

Thanks!

azure-text-analytics
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@bkosch I think the subcategories Date, Time, TimeRange when passed in "`piiCategories`" parameter are not being recognized. Only, the category DateTime seems to work. I think could be a bug in the service. Let me check investigate internally to check more about this behavior. Thanks!!




0 Votes 0 ·

Great! Here I was thinking I didn't know what a calendar date was! Thanks for the quick feedback

0 Votes 0 ·

1 Answer

romungi-MSFT avatar image
0 Votes"
romungi-MSFT answered

@bkosch We can confirm that this is a bug and only the Date subcategory PII entities are expected to be masked if we pass Date in the request.
All other sub-categories of DateTime are not enabled to work if passed in the request. As a workaround you can use the https://eastus.api.cognitive.microsoft.com/text/analytics/v3.1/entities/recognition/general?stringIndexType=TextElement_v8 API and identify text to be masked based on the entities returned in the response. This requires some processing on the client after the response is received until the sub category bug is fixed. Thanks.



· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for the advice. Do we have any idea when this bug will be fixed? Seems like it could possibly be a switch to turn on in a shorter time period.

0 Votes 0 ·

@bkosch This fix is expected to be rolled out earlier next month i.e October 2021.

0 Votes 0 ·