def compute_socres(self, file_path): # ev = EvaluateScore(self.label_list) # ev.run(file_path) # self.score_file_name = os.path.basename(file_path) data = get_data_from_file(file_path) self.batch_process(data) save_score = {'f1':self.f1,'prediction':self.precision,'recall':self.recall} # self.save_data(save_score,'scores') self._get_timestamp()
def generate_data(path): data = get_data_from_file(path) for line in data: line = eval(line) print(line['text']) yield predict_input_fn(line['text'])