diff --git a/src/absinth.py b/src/absinth.py index 71a0a3e1696f40bb9b91dcd5cdd00e963565a6d6..18147168921e5a6c883da1d22e9097388b186b13 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 15a29556165773d18de05827d78123b794e54bce..067d09cc5b962242d6505f370357c17cce46087a 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 7de08333e79d04edcb834a63e23e06ca6ed90f6d..abe3819c4668228a66b7834e3473851bbd84df13 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 '''