How archita-ai/invoice-anomaly-detector works
This repository is a small-business invoice anomaly detector, with both a Streamlit dashboard and a React/FastAPI interface. The individual-invoice workflow accepts a PDF, extracts and parses fields, validates and analyzes the record against historical data, then presents risk, duplicate, and explanation results. The broader batch-analysis capabilities include vendor features, anomaly detection, risk prioritization, model evaluation, and comparison. The graph preserves these documented stages; some batch modules are unsampled, so their unshown internal links are omitted.
Main entry points: run_pipeline.py Batch pipeline runner · invoice_pipeline.py PDF analysis pipeline · main.py FastAPI service · app.py Streamlit dashboard
Components 22
User interfaces
- Streamlit dashboard
app/app.py - React interface
frontend/src/App.jsx - FastAPI service
backend/main.py
Invoice ingestion
- PDF invoices
- Invoice CSV
- PDF text extraction
src/pdf_extractor.py - Field parsing
src/invoice_parser.py - PDF analysis pipeline
src/invoice_pipeline.py
Invoice analysis
- Invoice validation and analysis
src/invoice_analyzer.py - Historical invoices
data/invoices.csv
Batch intelligence
- Vendor features
src/feature_engineering.py - Advanced features
src/advanced_features.py - Anomaly detection
src/anomaly_detector.py - Duplicate detection
src/duplicate_detector.py - Vendor profiling
src/vendor_profile.py - Time features
src/time_features.py - Risk scoring
src/risk_scoring.py - Anomaly explanations
src/explanation_engine.py - Model evaluation
src/evaluate_model.py - Model comparison
src/compare_models.py - Batch pipeline runner
src/run_pipeline.py
Other components
- Invoice reviewer
Connections 21
- Invoice reviewer → Streamlit dashboard: uses
README.md - Invoice reviewer → React interface: uses
README.md - PDF invoices → Streamlit dashboard: uploads
app/app.py - Streamlit dashboard → PDF analysis pipeline: calls
app/app.py - PDF invoices → FastAPI service: uploads
backend/main.py - FastAPI service → PDF analysis pipeline: calls
backend/main.py - Invoice CSV → FastAPI service: uploads
backend/main.py - React interface → FastAPI service: requests
- PDF analysis pipeline → PDF text extraction: extracts text
src/invoice_pipeline.py - PDF analysis pipeline → Field parsing: parses fields
src/invoice_pipeline.py - PDF analysis pipeline → Invoice validation and analysis: analyzes record
src/invoice_pipeline.py - Invoice validation and analysis → Historical invoices: reads history
src/invoice_analyzer.py - Batch pipeline runner → Advanced features: runs
src/run_pipeline.py - Batch pipeline runner → Anomaly detection: runs
src/run_pipeline.py - Batch pipeline runner → Model evaluation: runs
src/run_pipeline.py - Batch pipeline runner → Model comparison: runs
src/run_pipeline.py - Batch pipeline runner → Duplicate detection: runs
src/run_pipeline.py - Batch pipeline runner → Vendor profiling: runs
src/run_pipeline.py - Batch pipeline runner → Time features: runs
src/run_pipeline.py - Batch pipeline runner → Risk scoring: runs
src/run_pipeline.py - Batch pipeline runner → Anomaly explanations: runs
src/run_pipeline.py