Spaces:
Sleeping
Sleeping
Update config.py
Browse files
config.py
CHANGED
|
@@ -2,14 +2,20 @@ import os
|
|
| 2 |
|
| 3 |
# --- Paths ---
|
| 4 |
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
|
|
| 5 |
DATA_PATH = os.path.join(BASE_DIR, "data", "synthetic_transactions_samples_5000.csv")
|
| 6 |
|
|
|
|
| 7 |
MODEL_SAVE_DIR = os.path.join(BASE_DIR, "models")
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
| 9 |
TFIDF_VECTORIZER_PATH = os.path.join(MODEL_SAVE_DIR, "tfidf_vectorizer.pkl")
|
| 10 |
-
|
| 11 |
|
| 12 |
-
# --- Columns ---
|
| 13 |
TEXT_COLUMN = "Sanction_Context"
|
| 14 |
LABEL_COLUMNS = [
|
| 15 |
"Red_Flag_Reason",
|
|
@@ -23,8 +29,8 @@ LABEL_COLUMNS = [
|
|
| 23 |
# --- TF-IDF Settings ---
|
| 24 |
TFIDF_MAX_FEATURES = 5000
|
| 25 |
NGRAM_RANGE = (1, 2)
|
| 26 |
-
USE_STOPWORDS = True
|
| 27 |
|
| 28 |
# --- Train/Test Split ---
|
| 29 |
RANDOM_STATE = 42
|
| 30 |
-
TEST_SIZE = 0.2
|
|
|
|
| 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",
|
|
|
|
| 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
|