MCPcopy Index your code
hub / github.com/RingBDStack/GDAP / calculate_bleu

Function calculate_bleu

seq2seq/utils.py:73–75  ·  view source on GitHub ↗

Uses sacrebleu's corpus_bleu implementation.

(output_lns, refs_lns, **kwargs)

Source from the content-addressed store, hash-verified

71
72
73def calculate_bleu(output_lns, refs_lns, **kwargs) -> dict:
74 """Uses sacrebleu's corpus_bleu implementation."""
75 return {"bleu": round(corpus_bleu(output_lns, [refs_lns], **kwargs).score, 4)}
76
77
78def build_compute_metrics_fn(task_name: str, tokenizer: PreTrainedTokenizer) -> Callable[[EvalPrediction], Dict]:

Callers 1

translation_metricsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected