How saumyasaini11/redact-scalarai works
The product is an offline DOCX PII pseudonymizer. Users inspect a document or run the pipeline: it extracts text, analyzes embedded media, detects and scores candidates, applies review decisions, preserves identity links, generates replacements, and writes a gated draft or final document with QA and reports. README capabilities also include evaluation and standalone verification. The pipeline and selected modules were sampled; some subsystem wiring is represented only where documented, so uncertain call edges are omitted.
Main entry points: pipeline.py Workflow Orchestrator · cli.py Command Interface · docx_io.py DOCX Package I/O · recognizers.py PII Recognition
Components 19
Document Analysis
- Command Interface
src/pii_redactor/cli.py - Runtime Settings
src/pii_redactor/config.py - Workflow Orchestrator
src/pii_redactor/pipeline.py - DOCX Package I/O
src/pii_redactor/docx_io.py - PII Recognition
src/pii_redactor/recognizers.py - Media Analysis
src/pii_redactor/media.py - Candidate Scoring
src/pii_redactor/ensemble.py
Review and Identity
- Review Decisions
src/pii_redactor/review.py - Private Review State
data/private - Identity Linking
src/pii_redactor/relationships.py
Redaction and QA
- Replacement Generator
src/pii_redactor/pseudonyms.py - Output Validation
src/pii_redactor/qa.py - DOCX Outputs
data/output
Reports and Evaluation
- Release Reporting
src/pii_redactor/reporting.py - Detection Evaluation
src/pii_redactor/evaluation.py
Other components
- User
- Reviewer
- Tesseract OCR
- spaCy Model
Connections 22
- User → Command Interface: invokes
- Reviewer → Private Review State: records decisions
- Command Interface → Runtime Settings: loads settings
- Command Interface → Workflow Orchestrator: runs workflow
- Command Interface → DOCX Package I/O: inspects or verifies
- Workflow Orchestrator → DOCX Package I/O: extracts and patches
- Workflow Orchestrator → PII Recognition: detects text PII
- Workflow Orchestrator → Media Analysis: analyzes media
- Media Analysis → Tesseract OCR: runs OCR
- PII Recognition → spaCy Model: runs NER
- Workflow Orchestrator → Candidate Scoring: merges and scores
- Workflow Orchestrator → Review Decisions: loads and applies
- Review Decisions → Private Review State: reads and writes
- Workflow Orchestrator → Identity Linking: assigns identity IDs
- Workflow Orchestrator → Replacement Generator: generates replacements
- Workflow Orchestrator → DOCX Package I/O: writes redacted package
- DOCX Package I/O → DOCX Outputs: writes DOCX
- Workflow Orchestrator → Output Validation: validates output
- Output Validation → DOCX Outputs: checks package
- Workflow Orchestrator → Release Reporting: builds summary
- Workflow Orchestrator → Detection Evaluation: evaluates detections
- Command Interface → Reviewer: shows queue status