def get_evaluation_document(cluster_info, gold_info, max_cluster_num): predict = [] for i in range(max_cluster_num): predict.append([]) for mention_num in range(len(cluster_info)): cluster_num = cluster_info[mention_num] predict[cluster_num].append(mention_num) ev_document = evaluation.EvaluationDocument(gold_info, predict) return ev_document
def get_evaluation_document(cluster_info, gold_info, doc_ids, max_cluster_num): predict = [] predict_dict = {} for mention_num in range(len(cluster_info)): cluster_num = cluster_info[mention_num] predict_dict.setdefault(cluster_num, []) predict_dict[cluster_num].append(doc_ids[mention_num]) #predict[cluster_num].append(mention_num) for k in sorted(predict_dict.keys()): predict.append(predict_dict[k]) ev_document = evaluation.EvaluationDocument(gold_info, predict) return ev_document
def get_evaluation_document(cluster_info, gold_info, max_cluster_num): predict = [] for i in range(max_cluster_num): predict.append([]) for mention_num in range(len(cluster_info)): cluster_num = cluster_info[mention_num] predict[cluster_num].append(mention_num) ''' print "a" for s in predict: if len(s) > 1: print s print print gold_info ''' ev_document = evaluation.EvaluationDocument(gold_info, predict) return ev_document