Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip empty dual graphs (Fixes Issue #11) #25

Merged
merged 1 commit into from
Jul 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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