node2vec.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:entity2rec 作者: D2KLab 项目源码 文件源码
def learn_embeddings(self, output):
        """
        Learn embeddings by optimizing the Skipgram objective using SGD.
        """

        self._simulate_walks()  # simulate random walks

        model = Word2Vec(self._walks, size=self.dimensions, window=self.window_size, min_count=0,
                         workers=self.workers, iter=self.iter, negative=25, sg=1)

        print("defined model using w2v")

        model.wv.save_word2vec_format(output, binary=True)

        print("saved model in word2vec binary format")

        return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号