From af8e06da09076a44f94fa429508a697afdc18a5b Mon Sep 17 00:00:00 2001 From: zimmermann <zimmermann@cl.uni-heidelberg.de> Date: Thu, 22 Mar 2018 19:34:45 +0100 Subject: [PATCH] Bugfixes. --- src/absinth.py | 4 ++-- src/abstinent.py | 6 +++--- src/config.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/absinth.py b/src/absinth.py index 71a0a3e..1814716 100644 --- a/src/absinth.py +++ b/src/absinth.py @@ -165,9 +165,9 @@ def induce(topic_name: str, result_list: list) -> (nx.Graph, list, dict): new_dict = dict() for key,value in edge_freq_dict.items(): if key[0] in new_dict: - new_dict[0].add({key[1]:value}) + new_dict[key[0]].add({key[1]:value}) else: - new_dict[0] = {key[1]:value} + new_dict[key[0]] = {key[1]:value} json.dump(new_dict, edge_file) diff --git a/src/abstinent.py b/src/abstinent.py index 15a2955..067d09c 100644 --- a/src/abstinent.py +++ b/src/abstinent.py @@ -374,7 +374,7 @@ def induce(topic_name: str, result_list: list) -> (nx.Graph, list, dict): if graph_in_existence == False: - node_freq_dict, edge_freq_dict = frequencies(target_string, result_list) + node_freq_dict, edge_freq_dict = frequencies(topic_name, result_list) with open(config.graph+node_dict_name, 'w') as node_file, open(config.graph+edge_dict_name, 'w') as edge_file: @@ -383,9 +383,9 @@ def induce(topic_name: str, result_list: list) -> (nx.Graph, list, dict): new_dict = dict() for key,value in edge_freq_dict.items(): if key[0] in new_dict: - new_dict[0].add({key[1]:value}) + new_dict[key[0]].add({key[1]:value}) else: - new_dict[0] = {key[1]:value} + new_dict[key[0]] = {key[1]:value} edge_freq_dict = new_dict json.dump(new_dict, edge_file) diff --git a/src/config.py b/src/config.py index 7de0833..abe3819 100644 --- a/src/config.py +++ b/src/config.py @@ -50,8 +50,8 @@ Choose filters for building the graph. - Only considers occurrences/cooccurrences for nodes/edges, that occur more often than these values. - Only considers edges with a weight beneath the maximum weight ''' -min_node_freq = 10 -min_edge_freq = 5 +min_node_freq = 8 +min_edge_freq = 4 max_weight = 0.9 ''' -- GitLab