How chetanjagan/parda works
Parda is a local-first document redaction product. A user uploads a PDF or photo, browser OCR and text/visual detectors find sensitive content, the user reviews and edits proposed regions, and export produces a flattened PDF or PNG plus an audit file. The repository also contains the Python reference pipeline, synthetic-data generation, model training, evaluation, and ONNX export used to build and verify the browser version. Relationships for unsampled subsystems are included only where the README documents them; source-level evidence is limited to the excerpts and index shown.
Main entry points: pipeline.ts Page analysis · redactor.py Redaction orchestrator · main.ts App workflow · worker.ts Background worker
Components 24
Browser app
- App workflow
web/src/app/main.ts - Page loading
web/src/app/pages.ts - Analysis client
web/src/app/client.ts - Background worker
web/src/app/worker.ts - Review controls
web/src/app/review.ts - PDF and audit export
web/src/app/export.ts
Browser inference
- Page analysis
web/src/app/pipeline.ts - Browser OCR
web/src/ocr/tesseract.ts - EasyOCR reader
web/src/easyocr/reader.ts - GLiNER inference
web/src/gliner/model.ts - PII rules and spans
web/src/core/rules.ts - Region geometry
web/src/core/boxes.ts - Visual detection
web/src/vision/yolo.ts
Python pipeline
- Redaction orchestrator
parda/pipeline/redactor.py - OCR engines
parda/ocr/engines.py - PII prediction
parda/pii/predict.py - Boxes and masking
parda/pipeline/boxes.py - YOLO detection
parda/vision/detectors.py
Data and models
- Synthetic documents
parda/synth/templates.py - PII training data
parda/pii/build_data.py - GLiNER training
parda/pii/train_gliner.py - ONNX export
parda/export/onnx_export.py - ONNX runtime
parda/export/onnx_runtime.py
Other components
- Document user
Connections 26
- Document user → App workflow: uploads document
README.md - App workflow → Page loading: loads pages
web/src/app/main.ts - App workflow → Analysis client: starts analysis
README.md - Analysis client → Background worker: dispatches work
web/src/app/client.ts - Background worker → Page analysis: runs analysis
web/src/app/worker.ts - Background worker → EasyOCR reader: runs photo OCR
web/src/app/worker.ts - Background worker → GLiNER inference: loads model
web/src/app/worker.ts - Page analysis → Browser OCR: reads text
README.md - Page analysis → EasyOCR reader: reads text
web/src/app/pipeline.ts - Page analysis → GLiNER inference: predicts spans
web/src/app/pipeline.ts - Page analysis → PII rules and spans: finds rule matches
web/src/app/pipeline.ts - Page analysis → Visual detection: finds visual regions
web/src/app/pipeline.ts - Page analysis → Region geometry: maps redactions
web/src/app/pipeline.ts - Analysis client → Review controls: opens review
web/src/app/client.ts - Document user → Review controls: edits findings
README.md - Review controls → PDF and audit export: exports result
README.md - App workflow → PDF and audit export: downloads output
web/src/app/main.ts - Redaction orchestrator → OCR engines: runs OCR
parda/pipeline/redact.py - Redaction orchestrator → PII prediction: predicts PII
parda/pipeline/redact.py - Redaction orchestrator → YOLO detection: detects regions
parda/pipeline/redact.py - Redaction orchestrator → Boxes and masking: builds redactions
parda/pipeline/redact.py - Synthetic documents → PII training data: supplies labeled pages
README.md - PII training data → GLiNER training: trains text model
README.md - GLiNER training → ONNX export: exports model
README.md - ONNX export → ONNX runtime: uses runtime helpers
parda/export/onnx_export.py - ONNX runtime → PII prediction: provides inference
parda/export/onnx_runtime.py