Skip to content

Commit

Permalink
Merge pull request #25 from spcl/empty-dual-graphs
Browse files Browse the repository at this point in the history
Skip empty dual graphs (Fixes Issue #11)
  • Loading branch information
tbennun committed Jul 3, 2020
2 parents 6bba4f3 + 6fc9adc commit fdeb882
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inst2vec/inst2vec_vocabulary.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,10 @@ def construct_vocabulary(data_folder, folders):
with open(D_file_open, 'rb') as f:
D = pickle.load(f)

# Skip empty graphs
if D.number_of_nodes() == 0:
continue

# Build H-dictionary
H_dic = build_H_dictionary(D, context_width, folder_mat, base_filename, dictionary, stmts_cut_off)
print('Print to', to_dump)
Expand Down

0 comments on commit fdeb882

Please sign in to comment.