Connect with one of our privacy experts to run this code.
Tabular Data
If it is only required to redact certain Columns such as
VisitNotes please see our PII Safe Sentiment Analysis Walkthrough.| ClientNm | DOfB | HlthCareNm | TempFd | VisitNotes |
|---|---|---|---|---|
| Stefan Krugler | 150368 | 2342345234 | NYC | Prescribed Stefan 10mg of Ibuprofen for his migraines. Will call him on +1 324 4325 5462 when I get the test results in |
| Hari Seldon | 201030 | 4947384944 | LA | Patient came in for a regular checkup. |
- The column names are all acronyms,
DOfBin particular is an uncommon way of referring to a date of birth. - Each cell value is written as an integer to save space, removing the hint of
/or.characters in identifying the date. TempFdcontains the city the individual lives in, but is stored in a temporary field.VisitNotesis a varchar free text field. This field is particularly useful for ML use cases, for example to determine the main visit reasons or for case resolution.
Processing As a String
A simple approach would be to join each row together and process as a single long string:Response Text
Formatting the Data Correctly
We can get better results by formatting the input in a"key1: value1, key2: value2, ... pattern, to make sure that each cell entry includes the column name for context. If multiple headers exist, the format should look like: "key1a: key1b: value1, key2: value2, .... Note that it’s important to put a colon at the end of each key.
Response Text
Best Practice: Correct Formatting With Link Batch
These examples process the entire table in a single API request to ensure consistent entity numbering. For larger tables it is recommended to process row by row, without numbered markers.
Response Text
JSON & XML
A similar approach applies for JSON and XML. Consider the following JSON:JSON
<key>: <value> ... pattern like above, add colons to the last key before each value and enable link_batch. The only difference is that a value might have multiple keys in the hierarchy, so we prepend all of those. The request payload then looks like:
Response Text