ja_lstm_parser.py 文件源码

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

项目:depccg 作者: masashi-y 项目源码 文件源码
def predict(self, xs):
        """
        batch: list of splitted sentences
        """
        xs = [self.extractor.process(x) for x in xs]
        batchsize = len(xs)
        ws, cs, ls = zip(*xs)
        cat_ys, dep_ys = self.forward(ws, cs, ls)
        return zip([y.data[1:-1] for y in cat_ys], [F.log_softmax(y[1:-1, :-1]).data for y in dep_ys])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号