Skip to content
Snippets Groups Projects
Commit 2ec78b3f authored by vvye's avatar vvye
Browse files

Add argument for printing timelines

parent 7c49fcd7
No related branches found
No related tags found
No related merge requests found
......@@ -20,10 +20,11 @@ def main(args):
for gold_timeline_name, gold_timeline in gold_timelines.items():
print(f'Topic {topic}, gold timeline {gold_timeline_name}')
print()
timeline = timeline_generation.make_timeline(articles, gold_timeline, keywords)
timeline_generation.print_timeline(timeline)
if args.print_timelines:
timeline_generation.print_timeline(timeline)
if args.timeline_output_path:
filename = Path(args.timeline_output_path) / f'{topic}_{gold_timeline_name}.txt'
......@@ -43,6 +44,9 @@ def main(args):
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--print_timelines',
action='store_true',
help='whether to print the timelines to the console after generating them')
parser.add_argument('--timeline_output_path',
type=str,
help='a directory to save the generated timeline files '
......
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