Updated on August 26, 2024

Toxicity check in unmask API

This API endpoint performs unmasking while analyzing the text for toxicity, providing detailed toxicity metrics for each unmasked value.

METHOD: PUT
ROUTE: /unmask
Headers:
{
“Authorization”: “Bearer <NAMESPACE_USER_API_KEY >”
}

Request payload

{ "policy_name": "Anonymization-policy-1",
"unmask": [
{
"token_value": " <PER>hSw8kAEB10 ITItAd8FsN</PER> lives in <ADDRESS>748785848000</ADDRESS> "
}
]
}

NOTE: policy_name is an optional parameter in request json. If provided, unmasking will use that policy’s metadata; otherwise, the default metadata will be used for unmasking.

Response:

{
"data": [
{
"token_value": "<PER>hSw8kAEB10 ITItAd8FsN</PER> lives in <ADDRESS>748785848000</ADDRESS>",
"value": "George Williams lives in Washington",
"toxicity_analysis": {
"toxicity": 0.00088834815,
"severe_toxicity": 0.000104515464,
"obscene": 0.00018257574,
"threat": 0.0001108902,
"insult": 0.00017547917,
"identity_attack": 0.00013806517
Date: 31/07/2024 Version: v1.2
PROTECTO DOCUMENTATION
}
}
],
"success": true,
"error": {
"message": ""}}

 

What are your feelings?
Scroll to Top