File size: 790 Bytes
d660683
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
preprocess_all.py

CLI script to run all core preprocessing steps in sequence:
1. Chunk PDFs from /raw_documents
2. Generate instruction pairs from structured lookup tables
3. Generate example QA pairs from HUD Notices

Usage:
    python preprocess_all.py
"""

import os
import subprocess

scripts = [
    "pdf_chunker.py",
    "generate_instruction_pairs.py",
    "generate_notice_qa.py"
]

print("🚀 Running HousingMind preprocessing pipeline...")

for script in scripts:
    print(f"▶️ Running {script}...")
    result = subprocess.run(["python", script], cwd=os.path.dirname(__file__))
    if result.returncode != 0:
        print(f"❌ Error running {script}")
        break
    else:
        print(f"✅ Finished {script}")

print("🎉 All preprocessing steps completed.")