aditya-grover / node2vec

http://snap.stanford.edu/node2vec/
MIT License
2.61k stars 912 forks source link

Problem in 'learn_embeddings' method #8

Open edilsonacjr opened 7 years ago

edilsonacjr commented 7 years ago

The code below should not use 'map' directly, since 'map' returns a object and not a list, the correct version would be 'walks = [list(map(str, walk)) for walk in walks]'.

def learn_embeddings(walks): ''' Learn embeddings by optimizing the Skipgram objective using SGD. ''' walks = [map(str, walk) for walk in walks] model = Word2Vec(walks, size=args.dimensions, window=args.window_size, min_count=0, sg=1, workers=args.workers, iter=args.iter) model.save_word2vec_format(args.output)

Junshuai-Song commented 7 years ago

This works for me. Thx!