loujie0822 / DeepIE

DeepIE: Deep Learning for Information Extraction
https://github.com/loujie0822/DeepIE
1.93k stars 358 forks source link

etl_span train.py 代码问题? #59

Open liutianling opened 3 years ago

liutianling commented 3 years ago

/run/relation_extraction/etl_span/train.py line 145-147 ans_dict = self.convert_spo_contour(qids, subject_pred, po_pred, eval_file, answer_dict, use_bert=self.args.use_bert) return ans_dict convert_spo_contour 在 285-315行 该函数代码中并没有 return ,这里是用了其他高级语法还是torch的什么特性,这里没有看懂。 谢谢大家了

huangdian-scu commented 3 years ago

仔细读代码,ans_dict并没用,是none,用的是传入函数内部被改变的answer_dict

feiyunamy commented 3 years ago

/run/relation_extraction/etl_span/train.py line 145-147 ans_dict = self.convert_spo_contour(qids, subject_pred, po_pred, eval_file, answer_dict, use_bert=self.args.use_bert) return ans_dict convert_spo_contour 在 285-315行 该函数代码中并没有 return ,这里是用了其他高级语法还是torch的什么特性,这里没有看懂。 谢谢大家了

预测输出被append到answer_dict中了