MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / chrf

Function chrf

test/general/lm_eval/metrics.py:128–139  ·  view source on GitHub ↗

chrF++ is a tool for automatic evaluation of machine translation output based on character n-gram precision and recall enhanced with word n-grams. Source: https://github.com/m-popovic/chrF Paper: https://www.aclweb.org/anthology/W15-3049.pdf Higher is better # TODO I think

(items)

Source from the content-addressed store, hash-verified

126
127
128def chrf(items):
129 """chrF++ is a tool for automatic evaluation of machine translation output
130 based on character n-gram precision and recall enhanced with word n-grams.
131 Source: https://github.com/m-popovic/chrF
132 Paper: https://www.aclweb.org/anthology/W15-3049.pdf
133
134 Higher is better # TODO I think
135 """
136 refs = list(zip(*items))[0]
137 preds = list(zip(*items))[1]
138 refs, preds = _sacreformat(refs, preds)
139 return sacrebleu.corpus_chrf(preds, refs).score
140
141
142def ter(items):

Callers

nothing calls this directly

Calls 1

_sacreformatFunction · 0.85

Tested by

no test coverage detected