def predict(self, xs):
"""
batch: list of splitted sentences
"""
xs = [self.extractor.process(x) for x in xs]
ws, ss, ps = zip(*xs)
cat_ys, dep_ys = self.forward(ws, ss, ps)
return zip([F.log_softmax(y[1:-1]).data for y in cat_ys],
[F.log_softmax(y[1:-1, :-1]).data for y in dep_ys])
评论列表
文章目录