def update_folder_paths(self): BaseModel.update_folder_paths(self) self.DTW_ROOT = os.path.join(self.ROOT, "dtw") self.DTW_DATA = os.path.join(self.DTW_ROOT, "dtw.npy") self.CLUSTER_ROOT = os.path.join(self.ROOT, "cluster") self.CLUSTER_DATA = os.path.join(self.CLUSTER_ROOT, "cluster.pickle") self.DICT_ROOT = os.path.join(self.ROOT, "dict") self.DICT_DATA = os.path.join(self.DICT_ROOT, "cluster.pickle")
def __init__(self, *args): BaseModel.__init__(self, *args) self.ALL = ["clean", "dtw", "cluster", "init", "sdict"] self.COMMANDS = self.ALL + ["pad", "find", "commands"] self.CLUSTER_MATRIX_SIZE = 1000 self.N_CLUSTERS = 50 # one of 'single', 'complete', 'average', 'weighted' self.CLUSTERING_METHOD = "complete" self.STATE_MULTIPLIER = 5 self.TRAIN_CORPORA = ["tomoe-ja-kanji"] self.EVAL_CORPORA = ["japanese-learner1", "japanese-native1"] self.ROOT = os.path.join("models", "strokehmm") self.update_folder_paths()
def clean(self): BaseModel.clean(self) for path in (self.DTW_ROOT, self.CLUSTER_ROOT, self.DICT_ROOT): if os.path.exists(path): shutil.rmtree(path)