Skip to content
Snippets Groups Projects
Commit b96a4fc5 authored by Victor Zimmermann's avatar Victor Zimmermann
Browse files

Update abstinent.py

parent 4145abd1
No related branches found
No related tags found
No related merge requests found
......@@ -446,6 +446,9 @@ def bag_of_senses(graph: nx.Graph, root_hub_list:list) -> dict:
"""
root_hub_count = len(root_hub_list)
if root_hub_count == 0:
return {0:list(graph.nodes)}
bag = {i:[] for i in range(root_hub_count)}
......@@ -531,13 +534,13 @@ def print_stats(stat_dict: dict) -> None:
print('\n[A] '+'\n[A] '.join(stat_string)+'\n')
with open('../baseline/statistics.txt', 'a') as stat_file:
with open('./statistics.txt', 'a') as stat_file:
stat_file.write('\n '.join(stat_string)+'\n\n')
write_header = not os.path.exists('.statistics.tsv')
with open('../baseline/.statistics.tsv', 'a') as stat_file:
with open('./.statistics.tsv', 'a') as stat_file:
if write_header:
......
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