research-document-archive / ml /run_pipeline.sh
datamatters24's picture
Upload ml/run_pipeline.sh with huggingface_hub
57ffff6 verified
#!/bin/bash
# Run the full ML crisis correlation pipeline
# Usage: ./run_pipeline.sh
# Designed to be run inside tmux
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PYTHON="/opt/epstein_env/bin/python3"
LOG_DIR="/var/www/research/storage/logs"
mkdir -p "$LOG_DIR"
echo "============================================="
echo " ML Crisis Correlation Pipeline"
echo " Started: $(date)"
echo "============================================="
echo ""
echo "[Stage 1/3] Extracting document dates..."
$PYTHON "$SCRIPT_DIR/01_extract_dates.py" 2>&1 | tee "$LOG_DIR/ml_01_dates.log"
echo ""
echo "[Stage 2/3] Seeding historical events..."
$PYTHON "$SCRIPT_DIR/02_seed_events.py" 2>&1 | tee "$LOG_DIR/ml_02_events.log"
echo ""
echo "[Stage 3/3] Correlating documents with crises..."
$PYTHON "$SCRIPT_DIR/03_correlate_crises.py" 2>&1 | tee "$LOG_DIR/ml_03_correlate.log"
echo ""
echo "============================================="
echo " Pipeline complete: $(date)"
echo "============================================="