attract-repel.py 文件源码

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

项目:attract-repel 作者: nmrksic 项目源码 文件源码
def print_word_vectors(word_vectors, write_path):
    """
    This function prints the collection of word vectors to file, in a plain textual format. 
    """

    f_write = codecs.open(write_path, 'w', 'utf-8')

    for key in word_vectors:
        print >>f_write, key, " ".join(map(unicode, numpy.round(word_vectors[key], decimals=6))) 

    print "Printed", len(word_vectors), "word vectors to:", write_path
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号