examples/metapath2vec_main.py
def learn_embeddings(walks, model_path, window_size, min_number):
    '''
    Learn embeddings by optimizing the Skipgram objective using SGD.
    '''
    walks = [list(map(str, walk)) for walk in walks]
    model = Word2Vec(walks, size=128, window=window_size, min_count=min_number, sg=1, workers=12,
                     iter=1)
    model.wv.save_word2vec_format(model_path)
    print("保存完毕")

    Learn embeddings by optimizing the Skipgram objective using SGD.
    
Learn embeddings by optimizing the Skipgram objective using SGD.
Learn embeddings by optimizing the Skipgram objective using SGD .
def learn_embeddings(walks, model_path, window_size, min_number):
    walks = [list(map(str, walk)) for walk in walks]
    model = Word2Vec(walks, size=128, window=window_size, min_count=min_number, sg=1, workers=12,
                     iter=1)
    model.wv.save_word2vec_format(model_path)
    print("保存完毕")
def learn_embeddings ( walks , model_path , window_size , min_number ) : walks = [ list ( map ( str , walk ) ) for walk in walks ] model = Word2Vec ( walks , size = 128 , window = window_size , min_count = min_number , sg = 1 , workers = 12 , iter = 1 ) model . wv . save_word2vec_format ( model_path ) print ( "保存完毕")
Learn embeddings by optimizing the Skipgram objective using SGD.
Learn embeddings by optimizing the Skipgram objective using SGD .
'''
    Learn embeddings by optimizing the Skipgram objective using SGD.
    '''
walks
model_path
window_size
min_number