PRESUNI_BPOM / PROGRESS.md
Expanic's picture
Deploy BPOM Compliance App
86f1108
|
Raw
History Blame Contribute Delete
2.49 kB

PROGRESS.md

Last Updated: 2026-05-28 05:20 Current Step: COMPLETE βœ…

Files

βœ… requirements.txt βœ… .env (template) βœ… rules/microba_rules.json βœ… rules/logam_berat_rules.json βœ… rules/cppob_rules.json βœ… prompts/classify_prompt.txt βœ… prompts/compliance_llm_prompt.txt βœ… prompts/report_prompt.txt βœ… data/regulations/ β€” 10 PDFs distributed across 4 category folders βœ… src/init.py βœ… src/ingest.py βœ… src/extractor.py β€” FIXED: dot separator, multiline, TPC/Kapang dan Khamir βœ… src/classifier.py β€” FIXED: DAIRY keywords, import re, gemini-2.0-flash βœ… src/rule_engine.py βœ… src/rag_query.py βœ… src/llm_narrator.py β€” FIXED: project-root paths, gemini-2.0-flash βœ… src/report_generator.py βœ… src/app.py β€” FIXED: full dasar hukum display, MISSING handling, file_path βœ… README.md

Test Results

  • Ingest test: ChromaDB populated (923 chunks: 131+186+389+217)
  • Extractor test: BOTH colon format AND dot separator format pass βœ…
  • Classifier test: 4/4 categories correct βœ…
  • Rule engine test: 2 violations detected (ALT, Timbal_Pb) βœ…
  • RAG query test: semantic search returns relevant results βœ…
  • LLM narrator test: fallback narration works βœ…
  • Report generator test: PDF generated βœ…
  • App test: Gradio boots on http://127.0.0.1:7860 βœ…

Bug Fixes Applied (2026-05-28)

  1. Extractor: Added flexible _SEP pattern for dot/colon/dash separators
  2. Extractor: Added "Total Plate Count"/"TPC" aliases for ALT
  3. Extractor: Handle "Kapang dan Khamir" combined format
  4. Extractor: Handle "Kadar Timbal (Pb)" with dot separator
  5. Extractor: Added _preprocess_text for multiline Key:\nValue format
  6. Extractor: Added _extract_section for === SECTION === format
  7. Extractor: Added "Tanggal Pengujian", "Produsen" to metadata patterns
  8. Classifier: Added 'pasteurisasi', 'sapi', 'uht' keywords for DAIRY
  9. Classifier: Moved 'import re' to top of file
  10. Classifier: Fixed prompt path to use project root
  11. App: Table column "Pasal" β†’ "Dasar Hukum" with full regulation+pasal
  12. App: Handle all-MISSING case (warns instead of "semua memenuhi")
  13. App: Robust PROJECT_ROOT via file
  14. LLM Narrator: Fixed prompt paths to use project root
  15. Gemini model: Updated from gemini-1.5-flash to gemini-2.0-flash

Notes

  • Python 3.10 required
  • numpy<2.0 for torch 2.2.2 compatibility
  • sentence-transformers 2.7.0 + transformers 4.40.0
  • google-generativeai deprecated β†’ consider migrating to google.genai