Skip to content
Snippets Groups Projects
Commit 36410d73 authored by vvye's avatar vvye
Browse files

Refactor evaluation a bit

parent b94d118d
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,11 @@ def evaluate(timeline, gold_timelines):
timeline = tilse_format(timeline)
ground_truth = timelines.GroundTruth([tilse_format(gold_timeline) for gold_timeline in gold_timelines])
return evaluator.evaluate_align_date_content_costs_many_to_one(timeline, ground_truth)
eval_result = evaluator.evaluate_align_date_content_costs_many_to_one(timeline, ground_truth)
ar1_f = eval_result['rouge_1']['f_score']
ar2_f = eval_result['rouge_2']['f_score']
return ar1_f, ar2_f
def date_f1(timeline, gold_timeline):
......
......@@ -17,9 +17,7 @@ def main():
print(f'Topic {topic}, gold timeline {gold_timeline_name}')
timeline = timeline_generation.make_timeline(articles, gold_timeline, keywords)
timeline_generation.print_timeline(timeline)
eval_result = evaluation.evaluate(timeline, [gold_timeline])
ar1_f = eval_result['rouge_1']['f_score']
ar2_f = eval_result['rouge_2']['f_score']
ar1_f, ar2_f = evaluation.evaluate(timeline, [gold_timeline])
date_f1 = evaluation.date_f1(timeline, gold_timeline)
print(f'{ar1_f},{ar2_f},{date_f1}')
break
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment