def process_and_evaluate(model, X, Y, k, n_jobs=1):
"""
Arguments:
X : query_id, query pairs
Y : dict of dicts (harvestable)
k : int how many to retrieve
"""
print("Starting query time with %d jobs" % n_jobs)
# TODO can we unzip Y and only pass the fucking chunk of y which
# it needs to harvest??
qids_rs = Parallel(n_jobs=n_jobs)(delayed(process_query)(model, x, Y, k)
for x in X)
print("Evaluating the results:")
scores = evaluate_results(qids_rs, Y, k)
return scores
评论列表
文章目录