goldReader.py 文件源码

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

项目:oie-benchmark 作者: gabrielStanovsky 项目源码 文件源码
def read(self, fn):
        d = defaultdict(lambda: [])
        with open(fn) as fin:
            for line in fin:
                data = line.strip().split('\t')
                text, base_rel, rel = data[:3]
                args = data[3:]
                confidence = 1

                curExtraction = Extraction(pred = rel, sent = text, confidence = float(confidence))
                for arg in args:
                    curExtraction.addArg(arg)

                d[text].append(curExtraction)
        self.oie = d
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号