def predict(self, test_file, verbose=False): start = time.time() self.test = dh.loaddata(test_file, self._word_file_path, normalize_text=True, split_hashtag=True, ignore_profiles=False) end = time.time() if (verbose == True): print('test resource loading time::', (end - start)) self._vocab = self.load_vocab() start = time.time() tX, tY, tD, tC, tA = dh.vectorize_word_dimension( self.test, self._vocab) tX = dh.pad_sequence_1d(tX, maxlen=self._line_maxlen) tC = dh.pad_sequence_1d(tC, maxlen=self._line_maxlen) tD = dh.pad_sequence_1d(tD, maxlen=11) end = time.time() if (verbose == True): print('test resource preparation time::', (end - start)) self.__predict_model([tC, tX, tD], self.test)
def load_train_validation_test_data(self): print("Loading resource...") self.train = dh.loaddata(self._train_file, self._word_file_path, normalize_text=True, split_hashtag=True, ignore_profiles=False, lowercase=True) self.validation = dh.loaddata(self._validation_file, self._word_file_path, normalize_text=True, split_hashtag=True, ignore_profiles=False, lowercase=True) if (self._test_file != None): self.test = dh.loaddata(self._test_file, self._word_file_path, normalize_text=True, split_hashtag=True, ignore_profiles=True)