(pred: EvalPrediction)
| 87 | return pred_str, label_str |
| 88 | |
| 89 | def summarization_metrics(pred: EvalPrediction) -> Dict: |
| 90 | pred_str, label_str = decode_pred(pred) |
| 91 | rouge: Dict = calculate_rouge(pred_str, label_str) |
| 92 | summ_len = np.round(np.mean(lmap(non_pad_len, pred.predictions)), 1) |
| 93 | rouge.update({"gen_len": summ_len}) |
| 94 | return rouge |
| 95 | |
| 96 | def translation_metrics(pred: EvalPrediction) -> Dict: |
| 97 | pred_str, label_str = decode_pred(pred) |
nothing calls this directly
no test coverage detected