import os from dataclasses import dataclass from dotenv import load_dotenv load_dotenv() @dataclass class Config: bd_file: str = os.getenv("BD_FILE", "data/raw/SuicideBD-dataset.csv") en_file: str = os.getenv("EN_FILE", "data/raw/English_Suicide_Detection.csv") bn_file: str = os.getenv( "BN_FILE", "data/raw/Bangla Suicidal Intention Dataset.csv" ) out_dir: str = os.getenv("OUT_DIR", "data/processed") artifact_dir: str = os.getenv("ARTIFACT_DIR", "outputs/artifacts") random_seed: int = int(os.getenv("RANDOM_SEED", "42")) test_size: float = float(os.getenv("TEST_SIZE", "0.3")) # text split val_size: float = float(os.getenv("VAL_SIZE", "0.5")) # within temp split # BD structured drop columns drop_cols = [ "id", "full_name", "method", "url", "data_source", "unix_time", "suicide_date", "latitude", "longitude", ] # Defaults you used defaults = { "profession_group": "unemployed", "religion": "muslim", "hometown": "Dhaka", "reason": "relationship problem", "reason_description": "relationship problem", } def ensure_dirs(cfg: Config) -> None: os.makedirs(cfg.out_dir, exist_ok=True) os.makedirs(cfg.artifact_dir, exist_ok=True)