-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
63 lines (48 loc) · 1.7 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
62
63
import os
class Config:
_project_path = os.path.dirname(os.path.abspath(__file__))
_default_data_path = os.path.join(_project_path, 'data')
_default_raw_report_zip_file = 'project_dataset_full.zip'
@staticmethod
def data_dir():
return os.getenv('DATA_PATH', Config._default_data_path)
@staticmethod
def raw_report_zip_file():
return os.getenv('RAW_REPORT_ZIP_FILE', os.path.join(
Config.data_dir(), Config._default_raw_report_zip_file
))
@staticmethod
def risk_dir():
return os.path.join(Config.data_dir(), 'risk_section')
@staticmethod
def log_dir():
return os.getenv(
'LOG_PATH', os.path.join(Config._project_path, 'logs')
)
@staticmethod
def models_dir():
return os.path.join(Config._project_path, 'models')
@staticmethod
def top2vec_models_dir():
return os.path.join(Config.models_dir(), 'top2vec_models')
@staticmethod
def keywords_dir():
return os.path.join(Config.models_dir(), 'keywords')
@staticmethod
def rake_keywords_dir():
return os.path.join(Config.keywords_dir(), 'rake')
@staticmethod
def text_rank_keywords_dir():
return os.path.join(Config.keywords_dir(), 'text_rank')
@staticmethod
def risk_sentiment_dir():
return os.path.join(Config.models_dir(), 'risk_section_sentiment')
@staticmethod
def finBERT_model_dir():
return os.path.join(Config.models_dir(), 'finBERT_model')
@staticmethod
def cache_dir():
return os.path.join(Config._default_data_path, '.cache')
@staticmethod
def spacy_model():
return os.getenv('SPACY_MODEL', 'en_core_web_md')