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
评论列表
文章目录