-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
64 lines (45 loc) · 2.23 KB
/
config.py
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from os.path import dirname, realpath, join
from pathlib import Path
class Config:
#这些变量是在所有实例之间共享的变量,类变量
#data
# data_dir = "../data/AMI EVALITA 2018"
# train_fp = r"data/AMI EVALITA 2018/en_training_anon.tsv"
# test_fp = r"data/AMI EVALITA 2018/en_testing_labeled_anon.tsv"
# test_fair_fp = r"data/unitended bias in AMI/synthetic_test_set.tsv"
# cleaned_train_fp = r"data/AMI EVALITA 2018/my_train.tsv"
# cleaned_test_fp = r"data/AMI EVALITA 2018/my_test.tsv"
OLD_DATA_DIC = {"AMI": {"train": r"data/AMI EVALITA 2018/en_training_anon.tsv",
"test": r"data/AMI EVALITA 2018/en_testing_labeled_anon.tsv",
"unbiased": r"data/AMI EVALITA 2018/unitended bias in AMI/synthetic_test_set.tsv"}
}
DATA_DIR = {"AMI": "data/AMI",
"IMDB-L": "data/IMDB-L",
"IMDB-S": "data/IMDB-S",
"KINDLE": "data/KINDLE"
}
DATA_DIC = {"AMI": "data/AMI/ori/ds_ami.pkl",
"IMDB-L": "data/IMDB-L/ori/ds_imdb_para.pkl",
"IMDB-S": "data/IMDB-S/ori/ds_imdb_sent.pkl",
"KINDLE": "data/KINDLE/ori/ds_kindle.pkl"
}
# HAS_LABELS_TEST = {"AMI": {"test": True, "unbiased": True}
# }
NUM_LABELS = {"AMI": 2,
"KINDLE": 2,
"IMDB-L": 2,
"IMDB-S": 2,
}
# VEC_DIR = r"data/AMI EVALITA 2018/vector"
CKPT_DIR = "saved_models/"
res_path = "../res/res.csv" #所有模型所有数据集的结果
# vectorizer_path = f"{data_dir}/tokenizer/" #只有特征学习的方法需要用到这里面的数据
# def __init__(self, model_name=None, lr=None,seed=None, log_name=None): #创建了这个类的实例时就会调用该方法
# #self代表类的实例而非类,在定义方法的时候必须要有
#
# # self.saved_model_path = f"saved_model/{model_name}_{self.vec_type}.pkl"
# # self.saved_topk_path = f"saved_model/{model_name}_{self.vec_type}_top_k.csv"
# self.lr = lr
# self.model_name = model_name
# self.seed = seed
# self.log_name = log_name