Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
boudinfl committed Aug 18, 2021
1 parent a5d8e22 commit e66d742
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions pke/supervised/feature_based/topiccorank.py
Expand Up @@ -121,6 +121,7 @@ def unify_with_domain_graph(self,
excluded_file=excluded_file)
else:
logging.warning("{} is not a reference file".format(input_file))
references = {}
pass

# initialize the topic_to_integer map
Expand Down Expand Up @@ -214,14 +215,18 @@ def candidate_weighting(self,
excluded_file=excluded_file,
prune_unreachable_nodes=prune_unreachable_nodes)

logging.info("resulting graph is {} nodes".format(
len(self.graph.nodes())))
nb_nodes = len(self.graph.nodes)

weights = [1.0] * len(self.graph.nodes)
logging.info("resulting graph is {} nodes".format(nb_nodes))

# weights = [1.0] * nb_nodes
weights = defaultdict(lambda:1.0)

# pre-compute the inner/outer normalizations
inner_norms = [0.0] * len(self.graph.nodes())
outer_norms = [0.0] * len(self.graph.nodes())
# inner_norms = [0.0] * nb_nodes
# outer_norms = [0.0] * nb_nodes
inner_norms = defaultdict(lambda:0.0)
outer_norms = defaultdict(lambda:0.0)

for j in self.graph.nodes():
inner_norm = 0
Expand Down

0 comments on commit e66d742

Please sign in to comment.