Skip to main content
POST
/
process
/
text
curl --request POST \ --url https://api.private-ai.com/community/process/text \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data ' { "text": [ "Hello John and Jane" ], "link_batch": false, "entity_detection": { "return_entity": true }, "processed_text": { "type": "MARKER", "pattern": "[UNIQUE_NUMBERED_ENTITY_TYPE]" } } '
[
  {
    "entities": [
      {
        "processed_text": "<string>",
        "text": "<string>",
        "best_label": "<string>",
        "labels": {},
        "location": "Location object containing the start-end character indexes of a given entity in the input text and in the processed text."
      }
    ],
    "entities_present": true,
    "characters_processed": 123,
    "languages_detected": {},
    "processed_text": "<string>"
  }
]

Authorizations

x-api-key
string
header
required

Body

application/json

API 3.0 Spec Definition

text
string[]
required

UTF-8 encoded message(s) to process. E.g. ["My name is Adam"] or ["I live at", "263 Spadina Av"]. Request processing time increases linearly with input text length, therefore maximum length is dependent on provisioned hardware and any timeouts set by the user. Private AI has tested up to 500K characters on the CPU and GPU containers.

When set to True, the list of inputs provided in text will be processed together as a single input by the Private AI PII detection model. This shares context between the different inputs and is useful when processing a sequence of short inputs, such as an SMS chat log. This option should only be enabled when the inputs are related, otherwise PII detection performance could be degraded.

entity_detection
PIIDetectionParams · object

This section contains a set of parameters to control the PII detection process. All fields have sensible default that can be changed for specific needs.

project_id
string | null

Used to categorize requests for reporting purposes. Limited to alphanumeric characters or the following special characters :_-

Maximum string length: 60
Pattern: ^[a-zA-Z0-9\-_\:]*$
processed_text
MarkerRedactedText · object

This section allows the user to generate redacted (default), synthetic or masked text.

Response

Successful Response

entities
EntityItem · object[]
required

A list of all entities found in the text.

entities_present
boolean
required

Returns True if the list of detected entities is not empty.

characters_processed
integer
required

The number of characters in all the text inputs.

languages_detected
Languages Detected · object
required

A dictionary containing ISO 639-1 language labels and the likelihood of their detection in the request payload.

processed_text
string
required

The redacted, synthetic or masked text.