-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.py
60 lines (48 loc) · 2.18 KB
/
configuration.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
import os
class ConfigClass:
def __init__(self):
# link to a zip file in google drive with your pretrained model
self._model_url = "https://drive.google.com/file/d/14w0Cc4oMyMqUDs25TI1eP1V95LGgPX9l/view?usp=sharing"
# False/True flag indicating whether the testing system will download
# and overwrite the existing model files. In other words, keep this as
# False until you update the model, submit with True to download
# the updated model (with a valid model_url), then turn back to False
# in subsequent submissions to avoid the slow downloading of the large
# model file with every submission.
self._download_model = False
self._model_dir = None
self.corpusPath = ''
self.savedFileMainFolder = ''
self.saveFilesWithStem = self.savedFileMainFolder + "/WithStem"
self.saveFilesWithoutStem = self.savedFileMainFolder + "/WithoutStem"
self.toStem = False
self.toLemm = False
# Used for tests
self.google_news_vectors_negative300_path = '../../../../GoogleNews-vectors-negative300.bin'
self.glove_twitter_27B_25d_path = '../../../../glove.twitter.27B.25d.txt'
print('Project was created successfully..')
def get_corpusPath(self):
return self.corpusPath
def get_model_url(self):
return self._model_url
def get_download_model(self):
return self._download_model
def set_output_path(self, path):
self.savedFileMainFolder = path
if 'nt' in os.name: # Windows system
self.saveFilesWithStem = self.savedFileMainFolder + "\\WithStem"
self.saveFilesWithoutStem = self.savedFileMainFolder + "\\WithoutStem"
else: # Unix system
self.saveFilesWithoutStem = self.savedFileMainFolder + "/WithoutStem"
self.saveFilesWithStem = self.savedFileMainFolder + "/WithStem"
def get_output_path(self):
"""
Get the output for the posting files
"""
return os.getcwd()
@property
def model_dir(self):
return self._model_dir
@model_dir.setter
def model_dir(self, model_dir):
self._model_dir = model_dir