How soham192/nlpproject works
Selective Audio Redaction accepts a PCM WAV and offers a browser/API or CLI workflow to detect sensitive speech, mask it reversibly, restore it with a key, and evaluate preservation. The core pipeline uses ASR, word alignment, entity detection, sample-range mapping, and AES-GCM masking into a manifest; evaluation checks non-redacted speech and entity accuracy. The README also documents waveform/playback visualization and demo output. Edges reflect the sampled orchestrator, API routes, and UI; unsampled implementation details are represented conservatively.
Main entry points: pipeline.py Pipeline orchestration · routes.py HTTP routes · App.jsx Redaction UI · evaluate.py Preservation evaluation
Components 19
Browser interface
- Redaction UI
web/src/App.jsx - Upload control
web/src/components/Dropzone.jsx - Waveform view
web/src/components/WaveformView.jsx - Result views
web/src/components
API service
- HTTP routes
api/routes.py - Job queue
api/jobs.py
Redaction pipeline
- Pipeline orchestration
src/pipeline.py - Speech recognition
src/asr.py - Word alignment
src/alignment.py - PII detection
src/detect.py - Span mapping
src/mapping.py - Stage timings
src/timing.py - Runtime configuration
src/config.py
Audio and verification
- PCM audio I/O
src/audio.py - Encrypted masking
src/mask.py - Manifest management
src/manifest.py - Preservation evaluation
src/evaluate.py - Demo outputs
src/demo.py
Other components
- User
Connections 25
- User → Redaction UI: uses
README.md - Upload control → Redaction UI: provides upload
web/src/App.jsx - Redaction UI → HTTP routes: requests operations
README.md - Redaction UI → Result views: renders results
web/src/App.jsx - Redaction UI → Waveform view: shows audio
README.md - HTTP routes → Job queue: submits work
api/routes.py - Job queue → Pipeline orchestration: runs pipeline
api/routes.py - HTTP routes → Pipeline orchestration: calls operations
api/routes.py - Pipeline orchestration → PCM audio I/O: loads audio
src/pipeline.py - Pipeline orchestration → Speech recognition: transcribes
src/pipeline.py - Pipeline orchestration → Word alignment: aligns words
src/pipeline.py - Pipeline orchestration → PII detection: detects entities
src/pipeline.py - Pipeline orchestration → Span mapping: maps spans
src/pipeline.py - Pipeline orchestration → Encrypted masking: masks ranges
README.md - Encrypted masking → Manifest management: stores ciphertext
README.md - Pipeline orchestration → Manifest management: writes artifact
README.md - HTTP routes → Preservation evaluation: requests evaluation
api/routes.py - Preservation evaluation → Speech recognition: re-transcribes audio
src/evaluate.py - Preservation evaluation → Word alignment: aligns transcripts
src/evaluate.py - Preservation evaluation → Manifest management: uses span metadata
src/evaluate.py - Demo outputs → PCM audio I/O: uses audio
src/demo.py - Demo outputs → Manifest management: reads manifest
src/demo.py - Pipeline orchestration → Stage timings: records stages
src/pipeline.py - Pipeline orchestration → Runtime configuration: uses settings
src/pipeline.py - HTTP routes → Runtime configuration: loads settings
api/main.py