parameters: (prediction, ground_truth)
return_statement: return precision, recall, f1
docstring: Evaluation matrix.
      :param prediction: a dictionary of labels. e.g {0:[1,0],1:[2],2:[3,4],3:[5,6,7]}
      :param ground_truth: a dictionary of labels
      :return:
docstring_summary: Evaluation matrix.
      :param prediction: a dictionary of labels. e.g {0:[1,0],1:[2],2:[3,4],3:[5,6,7]}
      :param ground_truth: a dictionary of labels
      :return:
docstring_tokens: Evaluation matrix . : param prediction : a dictionary of labels . e . g { 0 : [ 1 0 ] 1 : [ 2 ] 2 : [ 3 4 ] 3 : [ 5 6 7 ] } : param ground_truth : a dictionary of labels : return :
function: def evaluate_rm_gold(prediction, ground_truth):
      """
      Evaluation matrix.
      :param prediction: a dictionary of labels. e.g {0:[1,0],1:[2],2:[3,4],3:[5,6,7]}
      :param ground_truth: a dictionary of labels
      :return:
      """
      pos_gt = 0.0
      pos_pred = 0.0
      true_pos = 0.0
  
      for i in ground_truth:
          pos_gt += 1
          if i in prediction:
              pos_pred += 1
              if prediction[i] == ground_truth[i]:
                  true_pos += 1.0
  
      precision = true_pos / (pos_pred + 1e-8)
      recall = true_pos / (pos_gt + 1e-8)
      f1 = 2 * precision * recall / (precision + recall + 1e-8)
  
      print("%d / %d gold RMs tested" % (int(pos_pred), int(pos_gt)))
      return precision, recall, f1
function_tokens: def evaluate_rm_gold ( prediction , ground_truth ) : pos_gt = 0.0 pos_pred = 0.0 true_pos = 0.0 for i in ground_truth : pos_gt += 1 if i in prediction : pos_pred += 1 if prediction [ i ] == ground_truth [ i ] : true_pos += 1.0 precision = true_pos / ( pos_pred + 1e-8 ) recall = true_pos / ( pos_gt + 1e-8 ) f1 = 2 * precision * recall / ( precision + recall + 1e-8 ) print ( "%d / %d gold RMs tested" % ( int ( pos_pred ) , int ( pos_gt ) ) ) return precision , recall , f1