MCPcopy Create free account
hub / github.com/RingBDStack/GDAP / summarization_metrics

Function summarization_metrics

seq2seq/utils.py:89–94  ·  view source on GitHub ↗
(pred: EvalPrediction)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 3

calculate_rougeFunction · 0.85
lmapFunction · 0.85
decode_predFunction · 0.70

Tested by

no test coverage detected