__init__.py 文件源码

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

项目:spacy-dev-resources 作者: explosion 项目源码 文件源码
def word2vec(corpus_path, out_path, dim=150, threads=4, min_count=10, cbow=0):
    local("mkdir -p {}".format(dirname(out_path)))
    local(
        "python -m gensim.scripts.word2vec_standalone " +
        "-train {corpus_file} -output {file} -size {dim} -threads {threads} -min_count {min} -cbow {cbow}".format(
            corpus_file=corpus_path,
            dim=dim,
            file=out_path,
            threads=threads,
            min=min_count,
            cbow=cbow
        )
    )
    local("bzip2 {}".format(out_path), capture=True)
    # local(
    #     "python training/word_vectors.py {lang} {in_dir} {out_file} -n {threads} -d {dim}".format(
    #         dim=dim,
    #         in_dir=corpus_path,
    #         out_file=out_path,
    #         threads=threads,
    #         lang=language,
    #     )
    # )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号