def write_predictions(self, inputs):
rev_label_map = {j: i for (i, j) in self.label_map.items()}
predictions = numpy.argmax(self.model.predict(inputs), axis=1)
test_output_file = open("%s.predictions" % self.model_name_prefix, "w")
for prediction in predictions:
print >>test_output_file, rev_label_map[prediction + 1]
评论列表
文章目录