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
评论列表
文章目录