Translation Error Rate is an error metric for machine translation that measures the number of edits required to change a system output into one of the references Source: http://www.cs.umd.edu/~snover/tercom/ Paper: http://mt-archive.info/AMTA-2006-Snover.pdf Lower is better
(items)
| 140 | |
| 141 | |
| 142 | def ter(items): |
| 143 | """Translation Error Rate is an error metric for machine translation that |
| 144 | measures the number of edits required to change a system output into one |
| 145 | of the references |
| 146 | Source: http://www.cs.umd.edu/~snover/tercom/ |
| 147 | Paper: http://mt-archive.info/AMTA-2006-Snover.pdf |
| 148 | |
| 149 | Lower is better |
| 150 | """ |
| 151 | refs = list(zip(*items))[0] |
| 152 | preds = list(zip(*items))[1] |
| 153 | refs, preds = _sacreformat(refs, preds) |
| 154 | return sacrebleu.corpus_ter(preds, refs).score |
| 155 | |
| 156 | |
| 157 | def is_non_str_iterable(obj): |
nothing calls this directly
no test coverage detected