PDF mit benutzerdefiniertem Prompt anonymisieren
Anonymisieren Sie eine PDF-Datei mit einem benutzerdefinierten Prompt zur Anleitung der PII-Erkennung und -Schwärzung. Dieser Endpunkt ermöglicht es Ihnen, einen benutzerdefinierten Prompt anzugeben, der definiert, welche Informationen erkannt und geschwärzt werden sollen, was mehr Flexibilität als vordefinierte Tags bietet. Akzeptiert PDF als base64-kodierte Zeichenkette und einen benutzerdefinierten Prompt im Anfragekörper. Gibt anonymisierte PDF, erkannte PII-Entitäten und Verarbeitungsmetriken zurück. Verarbeitet nur die erste Seite der PDF.
Authorization
APIKeyHeader X-API-Key<token>
In: header
Request Body
application/json
pdf*string
Base64 encoded PDF document to be processed
prompt*string
Custom prompt to guide the PII detection process
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.pdf-redaction.com/api/anonymize/custom/pdf" \ -H "Content-Type: application/json" \ -d '{ "pdf": "base64_encoded_pdf_string", "prompt": "Redact all dates" }'{
"pdf": "base64_encoded_pdf_string",
"detected_pii": {
"path": "memory",
"entities": [
{
"entity_group": "CUSTOM",
"score": 0.92,
"word": "custom detected text",
"start": 0,
"end": 20,
"boxes": [
{
"text": "custom detected text",
"score": 0.92,
"x": 100,
"y": 200,
"width": 200,
"height": 25
}
]
}
],
"exception": "",
"json": ""
},
"processing_time": {
"total": 2.9577243328094482,
"stages": {
"PdfDataToSingleImage": 0.5639204978942871,
"PdfDataToDocument": 0.0037207603454589844,
"Ocr": 0.0004279613494873047,
"Ner": 1.7787754535675049,
"ImageDrawBoxes": 0.5246167182922363,
"SingleImageToPdf": 0.08531355857849121
}
}
}{
"error_code": "LLM_CALL_ERROR",
"message": "string"
}Empty
{
"error_code": "LLM_CALL_ERROR",
"message": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Empty