analogy_eval.py 文件源码

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

项目:histwords 作者: williamleif 项目源码 文件源码
def main():
    args = docopt("""
    Usage:
        analogy_eval.py [options] <representation> <representation_path> <task_path>

    Options:
        --neg NUM    Number of negative samples; subtracts its log from PMI (only applicable to PPMI) [default: 1]
        --w+c        Use ensemble of word and context vectors (not applicable to PPMI)
        --eig NUM    Weighted exponent of the eigenvalue matrix (only applicable to SVD) [default: 0.5]
    """)

    data = read_test_set(args['<task_path>'])
    xi, ix = get_vocab(data)
    representation = create_representation(args)
    accuracy_add, accuracy_mul = evaluate(representation, data, xi, ix)
    print args['<representation>'], args['<representation_path>'], '\t%0.3f' % accuracy_add, '\t%0.3f' % accuracy_mul
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号