Spaces:
Sleeping
Sleeping
Create config.py
Browse files
config.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
# --- Paths ---
|
| 4 |
+
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
| 5 |
+
|
| 6 |
+
# Path to dataset
|
| 7 |
+
DATA_PATH = os.path.join(BASE_DIR, "data", "synthetic_transactions_samples_5000.csv")
|
| 8 |
+
|
| 9 |
+
# Directory to save models
|
| 10 |
+
MODEL_SAVE_DIR = os.path.join(BASE_DIR, "models")
|
| 11 |
+
os.makedirs(MODEL_SAVE_DIR, exist_ok=True)
|
| 12 |
+
|
| 13 |
+
# Save paths for Logistic Regression model + artifacts
|
| 14 |
+
MODEL_PATH = os.path.join(MODEL_SAVE_DIR, "logreg_model.pkl") # ✅ Logistic Regression model
|
| 15 |
+
TFIDF_VECTORIZER_PATH = os.path.join(MODEL_SAVE_DIR, "tfidf_vectorizer.pkl")
|
| 16 |
+
LABEL_ENCODERS_PATH = os.path.join(MODEL_SAVE_DIR, "label_encoders.pkl")
|
| 17 |
+
|
| 18 |
+
# --- Text & Label Columns ---
|
| 19 |
+
TEXT_COLUMN = "Sanction_Context"
|
| 20 |
+
LABEL_COLUMNS = [
|
| 21 |
+
"Red_Flag_Reason",
|
| 22 |
+
"Maker_Action",
|
| 23 |
+
"Escalation_Level",
|
| 24 |
+
"Risk_Category",
|
| 25 |
+
"Risk_Drivers",
|
| 26 |
+
"Investigation_Outcome"
|
| 27 |
+
]
|
| 28 |
+
|
| 29 |
+
# --- TF-IDF Settings ---
|
| 30 |
+
TFIDF_MAX_FEATURES = 5000
|
| 31 |
+
NGRAM_RANGE = (1, 2)
|
| 32 |
+
USE_STOPWORDS = True # English stopwords will be removed if True
|
| 33 |
+
|
| 34 |
+
# --- Train/Test Split ---
|
| 35 |
+
RANDOM_STATE = 42
|
| 36 |
+
TEST_SIZE = 0.2
|