Future datasets do require a different rank computation. What this PR does is adding the argument compute_rank_for_item_func to the call to the evaluation:
evaluate(args.gold, args.guess, args.ks, args.rank_keys, compute_rank_for_item_func=compute_rank_for_item)
compute_rank_for_item_func is reached through .
I changed a few function names for readability.
All of this could also be achieved by putting all functions into a class RetrievalEvaluator such that compute_rank_for_item or other methods can be overridden.
compute_rank_for_item_func
to the call to the evaluation:evaluate(args.gold, args.guess, args.ks, args.rank_keys, compute_rank_for_item_func=compute_rank_for_item)
compute_rank_for_item_func
is reached through .RetrievalEvaluator
such thatcompute_rank_for_item
or other methods can be overridden.