Unverified Commit 400687d7 authored by Pein's avatar Pein Committed by GitHub
Browse files

add venue label filename; delete redundant code (#2491)


Co-authored-by: default avatarQuan (Andy) Gan <coin2028@hotmail.com>
parent bdb88df5
...@@ -9,6 +9,7 @@ if __name__ == "__main__": ...@@ -9,6 +9,7 @@ if __name__ == "__main__":
experiment_times = 1 experiment_times = 1
percent = 0.05 percent = 0.05
file = open(".../output_file_path/...") file = open(".../output_file_path/...")
file_1 = open(".../label 2/googlescholar.8area.venue.label.txt")
file_2 = open(".../label 2/googlescholar.8area.author.label.txt") file_2 = open(".../label 2/googlescholar.8area.author.label.txt")
check_venue = {} check_venue = {}
check_author = {} check_author = {}
...@@ -58,16 +59,13 @@ if __name__ == "__main__": ...@@ -58,16 +59,13 @@ if __name__ == "__main__":
count = 0 count = 0
for author in authors: for author in authors:
count += 1 count += 1
print("one more author " + str(count)) # print("one more author " + str(count))
temp_1 = np.array(author_embed_dict[author]) temp_1 = np.array(author_embed_dict[author])
if len(author_embedding) == 0: if len(author_embedding) == 0:
author_embedding = temp_1 author_embedding = temp_1
else: else:
author_embedding = np.vstack((author_embedding, temp_1)) author_embedding = np.vstack((author_embedding, temp_1))
# split data into training and testing # split data into training and testing
author_split = int(author_count * 0.8)
author_training = author_embedding[:author_split+1,:]
author_testing = author_embedding[author_split+1:,:]
print("splitting") print("splitting")
venue_split = int(venue_count * percent) venue_split = int(venue_count * percent)
venue_training = venue_embedding[:venue_split,:] venue_training = venue_embedding[:venue_split,:]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment