Update Word2Vec kwargs (#66)

This commit is contained in:
喵不嗷 2022-06-20 23:24:25 +08:00 committed by GitHub
parent 7e26f8a0b6
commit b39ff95370
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,15 +40,14 @@ class Node2Vec:
num_walks=num_walks, walk_length=walk_length, workers=workers, verbose=1)
def train(self, embed_size=128, window_size=5, workers=3, iter=5, **kwargs):
kwargs["sentences"] = self.sentences
kwargs["min_count"] = kwargs.get("min_count", 0)
kwargs["size"] = embed_size
kwargs["vector_size"] = embed_size
kwargs["sg"] = 1
kwargs["hs"] = 0 # node2vec not use Hierarchical Softmax
kwargs["workers"] = workers
kwargs["window"] = window_size
kwargs["iter"] = iter
kwargs["epochs"] = iter
print("Learning embedding vectors...")
model = Word2Vec(**kwargs)