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)
| 56 | |
| 57 | |
| 58 | def 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 |
no test coverage detected