How orbisearendel/re-dact works
RE-DACT is an offline, in-memory document de-identification engine with a built-in web interface. Its principal workflow accepts a document, validates and routes it for native extraction or OCR, detects and selects sensitive spans under a legal policy, applies a chosen redaction level, writes a format-specific result, and supports verification and signed audit reporting. The README also describes dataset, image, and plaintext adapters. Some of those implementations were not excerpted, so their relationships are shown only where documented; unsampled internals are not inferred.
Main entry points: server.py HTTP server · extract/pdf.py PDF extraction · writers/pdf.py PDF redaction · gate.py Content gate
Components 20
Ingestion and extraction
- Content gate
redact/gate.py - Format extraction
redact/extract - PDF extraction
redact/extract/pdf.py - OCR extraction
redact/extract/ocr.py
Detection and policy
- Span model
redact/entity.py - Regex and checksums
redact/detect/regex_rules.py - Context rules
redact/detect/context_rules.py - Local NER
redact/detect/gliner_ner.py - Visual PII
redact/detect/visual.py - Span merging
redact/detect/merge.py - Legal policy
redact/policy/policy.py
Transform and output
- Level transforms
redact/transform/levels.py - Format adapters
redact/writers - PDF redaction
redact/writers/pdf.py - Image redaction
redact/writers/image.py
Verification and audit
- Anti-leak rescan
redact/verify/rescan.py - Audit report
redact/verify/report.py
Web application
- HTTP server
server.py - Browser UI
ui/index.html
Other components
- Document user
Connections 21
- Document user → Browser UI: uploads document
README.md - Browser UI → HTTP server: submits job
server.py - HTTP server → Content gate: validates input
- Content gate → Format extraction: routes content
redact/gate.py - Format extraction → PDF extraction: extracts PDF
redact/extract/__init__.py - PDF extraction → Content gate: gets route plan
redact/extract/pdf.py - PDF extraction → OCR extraction: uses OCR
redact/extract/pdf.py - PDF extraction → Visual PII: detects visual PII
redact/extract/pdf.py - HTTP server → PDF redaction: runs redaction
server.py - PDF redaction → PDF extraction: extracts document
redact/writers/pdf.py - PDF redaction → Legal policy: filters entities
redact/writers/pdf.py - Regex and checksums → Context rules: uses context rules
redact/detect/regex_rules.py - Local NER → Span merging: merges spans
redact/detect/gliner_ner.py - HTTP server → Legal policy: configures policy
server.py - Legal policy → Level transforms: selects level
redact/transform/levels.py - HTTP server → Level transforms: sets level
server.py - HTTP server → Format adapters: dispatches formats
server.py - Format adapters → Image redaction: writes images
README.md - HTTP server → Anti-leak rescan: verifies output
- HTTP server → Audit report: builds report
- Audit report → Document user: provides certificate
README.md