Skip to main content

PII

Detect PII

Reports whether the supplied text contains personally identifiable information, optionally with a per-type entity breakdown.
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.pii.detect()

    # Handle response
    print(res)

Redact PII

Replaces detected PII with placeholders and returns the reverse mapping needed to restore the original text.
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.pii.redact()

    # Handle response
    print(res)

Restore PII

Reverses a redaction, substituting placeholders back to their original values using the mapping returned by Redact.
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.pii.restore()

    # Handle response
    print(res)