diff --git a/src/absinth.py b/src/absinth.py index e777ccf267d9c3cc4f9a9ff1e155d5ef8dd10b75..71a0a3e1696f40bb9b91dcd5cdd00e963565a6d6 100644 --- a/src/absinth.py +++ b/src/absinth.py @@ -1025,12 +1025,12 @@ def main(topic_id: int, topic_name: str, result_dict: dict) -> None: try: mean_degree = edge_count/node_count + stat_dict['L_rand'] = np.log(node_count)/np.log(mean_degree) + stat_dict['C_rand'] = 2 * mean_degree/node_count except ZeroDivisionError: mean_degree = 0 - - stat_dict['L_rand'] = np.log(node_count)/np.log(mean_degree) - stat_dict['C_rand'] = 2 * mean_degree/node_count - + stat_dict['L_rand'] = None + stat_dict['C_rand'] = 0 propagation_rank = config.colour_rank mst_rank = config.mst_rank diff --git a/src/abstinent.py b/src/abstinent.py index 5536301951ed8adecfba1b54111bafb0286291a4..15a29556165773d18de05827d78123b794e54bce 100644 --- a/src/abstinent.py +++ b/src/abstinent.py @@ -637,12 +637,13 @@ def main(topic_id: int, topic_name: str, result_dict: dict) -> None: try: mean_degree = edge_count/node_count + stat_dict['L_rand'] = np.log(node_count)/np.log(mean_degree) + stat_dict['C_rand'] = 2 * mean_degree/node_count except ZeroDivisionError: mean_degree = 0 + stat_dict['L_rand'] = None + stat_dict['C_rand'] = 0 - stat_dict['L_rand'] = np.log(node_count)/np.log(mean_degree) - stat_dict['C_rand'] = 2 * mean_degree/node_count - print('[a]', 'Disambiguating results.\t('+topic_name+')') bag = bag_of_senses(graph, root_hub_list)