MCPcopy Create free account
hub / github.com/Monalissaa/DisenDiff / pycoco_eval

Function pycoco_eval

utils/clipscore/generation_eval_utils.py:58–66  ·  view source on GitHub ↗

scorer is assumed to have a compute_score function. refs is a list of lists of strings cands is a list of predictions

(scorer, refs, cands)

Source from the content-addressed store, hash-verified

56
57
58def pycoco_eval(scorer, refs, cands):
59 '''
60 scorer is assumed to have a compute_score function.
61 refs is a list of lists of strings
62 cands is a list of predictions
63 '''
64 refs, cands = tokenize(refs, cands)
65 average_score, scores = scorer.compute_score(refs, cands)
66 return average_score, scores

Callers 1

get_all_metricsFunction · 0.85

Calls 1

tokenizeFunction · 0.70

Tested by

no test coverage detected