Open liutianling opened 3 years ago
仔细读代码,ans_dict并没用,是none,用的是传入函数内部被改变的answer_dict
/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中了
/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的什么特性,这里没有看懂。 谢谢大家了