evaluation.py 文件源码

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

项目:deep_srl 作者: luheng 项目源码 文件源码
def __init__(self, data, label_dict,
               gold_props_file=None,
               use_se_marker=False,
               pred_props_file=None, 
               word_dict=None):

    self.data = data
    self.best_accuracy = 0.0
    self.has_best = False
    self.label_dict = label_dict
    self.gold_props_file = gold_props_file
    self.pred_props_file = pred_props_file
    self.use_se_marker = use_se_marker

    if gold_props_file is None and pred_props_file is None:
      print ('Warning: not using official gold predicates. Not for formal evaluation.')
      ''' Output to mock gold '''
      assert word_dict != None
      conll_output_path = join(ROOT_DIR, 'temp/srl_pred_%d.gold.tmp' % os.getpid())
      print_gold_to_conll(self.data, word_dict, label_dict, conll_output_path)
      self.pred_props_file = conll_output_path
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号