def compute_single(self, INPUT_ITR):
assert(self.method is not None)
print("Scoring {}".format(self.method))
self._ref = []
self.V = []
self.current_filename = None
ITR = itertools.imap(self.score_document, tqdm(INPUT_ITR))
for row in ITR:
# Require that filenames don't change in compute_single
assert (self.current_filename in [None, row["_filename"]])
self.current_filename = row["_filename"]
self.V.append(row["doc_vec"])
self._ref.append(int(row["_ref"]))
self.V = np.array(self.V)
self._ref = np.array(self._ref)
评论列表
文章目录