lstm_tagger_ph.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:depccg 作者: masashi-y 项目源码 文件源码
def predict(self, xs):
        """
        batch: list of splitted sentences
        """
        batchsize = len(xs)
        fs = [self.extractor.process(x) for x in xs]
        ws, ss, ps = concat_examples(fs, padding=-1)
        ys = self.forward(ws, ss, ps)
        ys = F.transpose(F.stack(ys, 2), (0, 2, 1))
        return [F.squeeze(y, 0).data[1:len(x) + 1] for x, y in \
                zip(xs, F.split_axis(ys, batchsize, 0))]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号