How tarequesyed/amp-gen-material-passport works
AMP-GEN turns a scanned construction Bill of Quantities into a material passport with normalized quantities, material categories, and estimated mass and embodied carbon. The main reproducible workflow uses reviewed BoQ items by default; optional OCR generates candidate text from the scanned PDF. Normalization validates the 64 items, then export writes JSON, fills the Excel template, and creates a summary chart. A Streamlit interface presents passport metrics and analysis, with an optional Ollama-assisted classification path. The dashboard’s full data-loading and editing behavior is not shown in the sampled source, so uncertain wiring is omitted.
Main entry points: export_outputs.py Passport export · pipeline.py Pipeline runner · normalize.py Normalize quantities · app.py Passport dashboard
Components 17
Passport pipeline
- Pipeline runner
src/pipeline.py - BoQ OCR
src/extract_boq.py - Normalize quantities
src/normalize.py - Passport export
src/export_outputs.py
Material classification
- Rule classifier
src/normalize.py - Confidence router
src/llm_extractor.py
Interactive dashboard
- Passport dashboard
app.py
Inputs and outputs
- Reviewed BoQ items
data/reviewed_items.json - Scanned BoQ
input/BoQ_CBRI_Principals_Residence.pdf - Passport template
input/AMP_Passport_Template.xlsx - Normalized records
- Passport JSON
output/passport.json - Filled passport
output/passport_filled.xlsx - Summary chart
- Building metadata
output/building_meta.json
Other components
- Project user
- Ollama service
Connections 19
- Project user → Pipeline runner: runs pipeline
- Pipeline runner → BoQ OCR: optionally runs
- Pipeline runner → Normalize quantities: runs
- Pipeline runner → Passport export: runs
- BoQ OCR → Scanned BoQ: reads
- Normalize quantities → Reviewed BoQ items: reads
- Normalize quantities → Normalized records: writes
- Normalize quantities → Rule classifier: classifies with
- Passport export → Normalized records: reads
- Passport export → Passport template: reads
- Passport export → Passport JSON: writes
- Passport export → Filled passport: writes
- Passport export → Summary chart: writes
- Project user → Passport dashboard: views and explores
- Passport dashboard → Passport JSON: reads
- Passport dashboard → Building metadata: reads
- Passport dashboard → Confidence router: classifies with
- Confidence router → Ollama service: requests classification
- Confidence router → Rule classifier: falls back to