-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
46 lines (41 loc) · 1.21 KB
/
Copy pathconfig.py
File metadata and controls
46 lines (41 loc) · 1.21 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
# Đường dẫn file
DATA_DIR = 'dataset'
MODEL_DIR = 'models'
CSV_FILE = 'enron_spam_data.csv'
DEFAULT_MODEL_FILE = 'best_spam_detector.pkl'
# URL dataset
DATASET_URL = 'https://github.com/MWiechmann/enron_spam_data/raw/refs/heads/master/enron_spam_data.zip'
# Cấu hình model
TRAIN_TEST_SPLIT = 0.3
RANDOM_STATE = 42
# Cấu hình TF-IDF
TFIDF_CONFIG = {
'stop_words': 'english',
'ngram_range': (1, 2),
'max_features': 50000,
'min_df': 2,
'max_df': 0.95
}
# Cấu hình các thuật toán
MODEL_CONFIG = {
'naive_bayes': {
'class': 'MultinomialNB',
'params': {}
},
'logistic_regression': {
'class': 'LogisticRegression',
'params': {
'max_iter': 1000,
'class_weight': 'balanced'
}
}
}
# Email test mẫu
SAMPLE_EMAILS = [
"Meeting scheduled for tomorrow at 10 AM.", # ham
"URGENT: Your account has been compromised. Click the link below to secure it immediately.", # spam
"Here are the quarterly sales reports.", # ham
"Limited-time offer! Buy now and get 50% off.", # spam
"Congratulations! You've won a free lottery, click here to claim.", # spam
"Can you send me the project files?", # ham
]