Ner Files Uri
Detect entities such as PII, PHI or PCI in the file located at the provided URI using Private AI’s entity detection engine. This is only doing the detection of entities, no redacted file is created.
This route is similar to /ner/files/base64, but relies on URIs instead of base64-encoded strings. As this route avoids the overhead of base64 encoding, it is more suitable for processing large files and large volumes of data.
The uri may be a local file path, an s3:// URI, or an HTTP or HTTPS URL. An HTTP or HTTPS URL, including a presigned S3 URL, is downloaded only when its host is listed in PAI_ALLOWED_HTTP_DOMAINS. Redirects are not followed.
Set return_extracted_text to True to also receive the full text extracted from the file (the OCR output for images and scanned PDFs) in the extracted_text field. Note that this extracted text is not de-identified.
This route supports the following content types: application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document, image/bmp, image/gif, image/jpeg, image/jpg, image/png, image/tif, image/tiff, image/x-ms-bmp, text/csv, text/plain
Body
URI of the file to be processed. This can be a file path on the host machine (for example /Users/sam/files/file.pdf), an s3:// URI, or an HTTP or HTTPS URL. An HTTP or HTTPS URL, including a presigned S3 URL, is downloaded only when its host is listed in PAI_ALLOWED_HTTP_DOMAINS. Redirects are not followed.
Controls whether the response contains the extracted_text field, which holds the full text extracted from the input file (via OCR for images and scanned PDFs) before any redaction is applied. Note that the extracted text is not de-identified, so any PII it contains is returned as is, independently of the entity_detection.return_entity setting. Turning this ON can significantly increase the size of the response, so it defaults to False.
Response
Successful Response
The full text that was extracted from the input file, before any redaction is applied. It corresponds to the OCR output for image files and scanned PDFs, and to the file contents for text-based formats such as .txt and .csv. Note that this text is not de-identified, so any PII it contains is returned in the clear.
This field is only present if the return_extracted_text option is set to True in the request.